Skip to content

Commit a96d1a8

Browse files
committed
在 onPagerFetchingAnyRemoteSource 确保 fullSyncState 更新
1 parent 05664d9 commit a96d1a8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/shared/ui-subject/src/commonMain/kotlin/ui/subject/collection/UserCollectionsViewModel.kt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import kotlinx.coroutines.flow.filter
1919
import kotlinx.coroutines.flow.firstOrNull
2020
import kotlinx.coroutines.flow.flowOf
2121
import kotlinx.coroutines.flow.map
22+
import kotlinx.coroutines.launch
2223
import me.him188.ani.app.data.models.bangumi.BangumiSyncState
2324
import me.him188.ani.app.data.models.preference.MyCollectionsSettings
2425
import me.him188.ani.app.data.models.subject.SubjectCollectionInfo
@@ -75,6 +76,9 @@ class UserCollectionsViewModel : AbstractViewModel(), KoinComponent {
7576
createEditableSubjectCollectionTypeState = { createEditableSubjectCollectionTypeState(it) },
7677
onPagerFetchingAnyRemoteSource = { enable ->
7778
if (!enable) {
79+
backgroundScope.launch {
80+
fullSyncState.emit(BangumiSyncState.Finished(0, null))
81+
}
7882
fullSyncTasker.cancel()
7983
return@UserCollectionsState
8084
}

0 commit comments

Comments
 (0)