From 0dca02b9197f677ea1295ef6c654fe1886f3fa0a Mon Sep 17 00:00:00 2001 From: Ray <154766448+damontecres@users.noreply.github.com> Date: Tue, 10 Mar 2026 18:10:14 -0400 Subject: [PATCH] Fix race condition when updating preferences (#1078) ## Description Fixes a race condition saving preferences. It would be triggered if you have "Remember selected tabs" enabled and either: 1) changed settings while on a library grid page or 2) changed settings on a page navigated _from_ a library grid page and then returned to the grid ### Related issues I think this will fix #1075 ### Testing Emulator following the steps above ## Screenshots N/A ## AI or LLM usage None --- .../com/github/damontecres/wholphin/services/hilt/AppModule.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/com/github/damontecres/wholphin/services/hilt/AppModule.kt b/app/src/main/java/com/github/damontecres/wholphin/services/hilt/AppModule.kt index 991a8e98..a44ab65b 100644 --- a/app/src/main/java/com/github/damontecres/wholphin/services/hilt/AppModule.kt +++ b/app/src/main/java/com/github/damontecres/wholphin/services/hilt/AppModule.kt @@ -171,7 +171,7 @@ object AppModule { if (preferences.appPreferences.interfacePreferences.rememberSelectedTab) { scope.launch(ExceptionHandler()) { appPreference.updateData { - preferences.appPreferences.updateInterfacePreferences { + it.updateInterfacePreferences { putRememberedTabs(key(itemId), tabIndex) } }