Skip to content

Commit

Permalink
refactor: remove unused code [SyncStatus]
Browse files Browse the repository at this point in the history
* hasBeenMarkedAsChangedInMemory
* markDataAsChanged
* sPauseCheckingDatabase
* sMarkedInMemory
  • Loading branch information
david-allison authored and BrayanDSO committed Mar 20, 2024
1 parent ed5f1e5 commit 2bf7a5d
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions AnkiDroid/src/main/java/com/ichi2/utils/SyncStatus.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ enum class SyncStatus {
NO_ACCOUNT, NO_CHANGES, HAS_CHANGES, FULL_SYNC, BADGE_DISABLED, ERROR;

companion object {
private var sPauseCheckingDatabase = false
private var sMarkedInMemory = false

suspend fun getSyncStatus(context: Context, auth: SyncAuth?): SyncStatus {
if (isDisabled) {
Expand Down Expand Up @@ -76,19 +74,5 @@ enum class SyncStatus {
val preferences = AnkiDroidApp.sharedPrefs()
return !preferences.getBoolean("showSyncStatusBadge", true)
}

/** To be converted to Rust */
fun markDataAsChanged() {
if (sPauseCheckingDatabase) {
return
}
sMarkedInMemory = true
AnkiDroidApp.sharedPrefs().edit { putBoolean("changesSinceLastSync", true) }
}

/** Whether a change in data has been detected - used as a heuristic to stop slow operations */
fun hasBeenMarkedAsChangedInMemory(): Boolean {
return sMarkedInMemory
}
}
}

0 comments on commit 2bf7a5d

Please sign in to comment.