Skip to content

Commit fb94ed9

Browse files
committed
fix: automatically log user out when enabling full local mode and no auth instance set
1 parent d248b27 commit fb94ed9

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

app/src/main/java/com/github/libretube/ui/preferences/InstanceSettings.kt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,13 @@ class InstanceSettings : BasePreferenceFragment() {
126126
.show(childFragmentManager, DeleteAccountDialog::class.java.name)
127127
true
128128
}
129+
130+
findPreference<SwitchPreferenceCompat>(PreferenceKeys.FULL_LOCAL_MODE)?.setOnPreferenceChangeListener { _, newValue ->
131+
// when the full local mode gets enabled, the fetch instance is no longer used and replaced
132+
// fully by local extraction. thus, the user has to be logged out from the fetch instance
133+
if (newValue == true && !authInstanceToggle.isChecked) logoutAndUpdateUI()
134+
true
135+
}
129136
}
130137

131138
private suspend fun initInstancesPref(

0 commit comments

Comments
 (0)