Prune a list's settings only when the store read is still the active one, provider included (#100)

This commit is contained in:
makiolaj committed 2026-11-20 18:01:45 +01:00
1 parent fe63653690
commit bb7d36385f
1 file changed
+3 -3
@@ -56,9 +56,9 @@ class TasksRepositoryImpl @Inject constructor(
) : TasksRepository {
override fun taskLists(): Flow<List<TaskList>> = observing {
val chosen = providerResolver.storageMode
val store = providerResolver.active(chosen)
dataSource.taskLists().also { lists -> if (providerResolver.storageMode == chosen) forgetGoneLists(store, lists) }
// The store read, auto mode and provider included: a switch meanwhile leaves the lists of the other.
val store = providerResolver.active()
dataSource.taskLists().also { lists -> if (providerResolver.active() == store) forgetGoneLists(store, lists) }
}
private val listsPrunedFor = AtomicReference<Pair<Pair<StorageMode, String?>, Set<Long>>?>(null)