Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 206c7378 authored by cketti's avatar cketti
Browse files

Don't reuse AccountsLiveData instance

When the last account is deleted while AccountsLiveData is active it will hold on to an empty list. Then, when an account is added again and AccountsLiveData becomes active again, the empty list is emitted before the list containing the new account is emitted. This lead to the onboarding screen being shown when it shouldn't have. Not holding on to old AccountsLiveData instances will get rid of this problem.
parent 4f7fb641
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -15,7 +15,7 @@ import org.koin.core.qualifier.named
import org.koin.dsl.module

val settingsUiModule = module {
    single { AccountsLiveData(get()) }
    factory { AccountsLiveData(get()) }
    viewModel { SettingsViewModel(accountManager = get(), accounts = get()) }

    factory { GeneralSettingsDataStore(jobManager = get(), themeManager = get(), appLanguageManager = get()) }