[mob][photos] Fix remote fetch counter

This commit is contained in:
laurenspriem
2024-10-24 19:46:42 +05:30
parent b85e830a2b
commit 8bf29ee82f

View File

@@ -110,7 +110,10 @@ class MLService {
bool canFetch() {
if (localSettings.isMLIndexingEnabled) return true;
if (lastRemoteFetch == null) return true;
if (lastRemoteFetch == null) {
lastRemoteFetch = DateTime.now().millisecondsSinceEpoch;
return true;
}
final intDiff = DateTime.now().millisecondsSinceEpoch - lastRemoteFetch!;
final bool canFetch = intDiff > _kRemoteFetchCooldownOnLite;
if (canFetch) {