Skip to content

Commit

Permalink
Disable 'automatic sync' while migration is ongoing
Browse files Browse the repository at this point in the history
Sync is blocked, but there's no point in showing a dialog - instead
don't perform the operation

Issue 5304
Issue 13094
  • Loading branch information
david-allison committed Feb 28, 2023
1 parent 42725a1 commit cd9da5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions AnkiDroid/src/main/java/com/ichi2/anki/DeckPicker.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1100,8 +1100,8 @@ open class DeckPicker :
val autoSyncIsEnabled = preferences.getBoolean("automaticSyncMode", false)
val syncIntervalPassed = TimeManager.time.intTimeMS() - lastSyncTime > AUTOMATIC_SYNC_MIN_INTERVAL
val isNotBlockedByMeteredConnection = preferences.getBoolean(getString(R.string.metered_sync_key), false) || !isActiveNetworkMetered()

if (isLoggedIn() && autoSyncIsEnabled && NetworkUtils.isOnline && syncIntervalPassed && isNotBlockedByMeteredConnection) {
val canSync = canSync(this)
if (isLoggedIn() && autoSyncIsEnabled && NetworkUtils.isOnline && syncIntervalPassed && isNotBlockedByMeteredConnection && canSync) {
Timber.i("Triggering Automatic Sync")
sync()
}
Expand Down

0 comments on commit cd9da5c

Please sign in to comment.