fix: automatically log user out when enabling full local mode and no auth instance set

This commit is contained in:
Bnyro 2025-04-25 17:08:04 +02:00
parent d248b27672
commit fb94ed989e
No known key found for this signature in database

View File

@ -126,6 +126,13 @@ class InstanceSettings : BasePreferenceFragment() {
.show(childFragmentManager, DeleteAccountDialog::class.java.name)
true
}
findPreference<SwitchPreferenceCompat>(PreferenceKeys.FULL_LOCAL_MODE)?.setOnPreferenceChangeListener { _, newValue ->
// when the full local mode gets enabled, the fetch instance is no longer used and replaced
// fully by local extraction. thus, the user has to be logged out from the fetch instance
if (newValue == true && !authInstanceToggle.isChecked) logoutAndUpdateUI()
true
}
}
private suspend fun initInstancesPref(