mirror of
https://github.com/kavishdevar/librepods.git
synced 2026-09-02 01:09:08 +02:00
android: remove bypass when going back to 'not supported' page in onboarding
This commit is contained in:
+4
@@ -47,6 +47,7 @@ import me.kavishdevar.librepods.presentation.theme.LibrePodsTheme
|
|||||||
import me.kavishdevar.librepods.utils.XposedState
|
import me.kavishdevar.librepods.utils.XposedState
|
||||||
import me.kavishdevar.librepods.utils.bypassDeviceCheck
|
import me.kavishdevar.librepods.utils.bypassDeviceCheck
|
||||||
import me.kavishdevar.librepods.utils.isSupported
|
import me.kavishdevar.librepods.utils.isSupported
|
||||||
|
import me.kavishdevar.librepods.utils.removeDeviceCheckBypass
|
||||||
|
|
||||||
@OptIn(ExperimentalPermissionsApi::class, ExperimentalMaterial3Api::class)
|
@OptIn(ExperimentalPermissionsApi::class, ExperimentalMaterial3Api::class)
|
||||||
@Composable
|
@Composable
|
||||||
@@ -202,6 +203,9 @@ fun OnboardingScreen(
|
|||||||
onBackward = {
|
onBackward = {
|
||||||
animationScope.launch {
|
animationScope.launch {
|
||||||
if (state.canScrollBackward) state.animateScrollToItem(if (isSupported) 1 else 2)
|
if (state.canScrollBackward) state.animateScrollToItem(if (isSupported) 1 else 2)
|
||||||
|
if (!isSupported) {
|
||||||
|
removeDeviceCheckBypass(sharedPreferences)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onForward = onOnboardingComplete
|
onForward = onOnboardingComplete
|
||||||
|
|||||||
@@ -42,3 +42,7 @@ fun isSupported(sharedPreferences: SharedPreferences): Boolean {
|
|||||||
fun bypassDeviceCheck(sharedPreferences: SharedPreferences) {
|
fun bypassDeviceCheck(sharedPreferences: SharedPreferences) {
|
||||||
sharedPreferences.edit{ putBoolean("bypass_device_check.v2", true) }
|
sharedPreferences.edit{ putBoolean("bypass_device_check.v2", true) }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun removeDeviceCheckBypass(sharedPreferences: SharedPreferences) {
|
||||||
|
sharedPreferences.edit{ putBoolean("bypass_device_check.v2", false) }
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user