Skip to content

Commit 266f1e8

Browse files
authored
Merge pull request #7351 from Bnyro/master
fix: automatically log user out when enabling full local mode and no auth instance set
2 parents 8f901ee + fb94ed9 commit 266f1e8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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)