fix: file transfer, web (#12565)

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou
2025-08-09 15:54:00 +08:00
committed by GitHub
parent 466d456760
commit ad1ed132d1

View File

@@ -30,15 +30,17 @@ enum SortBy {
class JobID {
int _count = 0;
int next() {
String v = bind.mainGetCommonSync(key: 'transfer-job-id');
try {
return int.parse(v);
if (!isWeb) {
String v = bind.mainGetCommonSync(key: 'transfer-job-id');
return int.parse(v);
}
} catch (e) {
// unreachable. But we still handle it to make it safe.
// If we return -1, we have to check it in the caller.
_count++;
return _count;
debugPrint("Failed to get transfer job id: $e");
}
// Finally increase the count if on the web or if failed to get the id.
_count++;
return _count;
}
}