fix: load after setup screen

Signed-off-by: rhunk <101876869+rhunk@users.noreply.github.com>
This commit is contained in:
rhunk
2024-07-06 17:24:32 +02:00
parent fd619ec8b9
commit 05359f28d8
3 changed files with 8 additions and 4 deletions

View File

@@ -69,8 +69,8 @@ class RemoteSharedLibraryManager(
remoteSideContext.log.info("Updating sif from $currentVersion to $latestVersion")
if (downloadLatest(libraryFile)) {
remoteSideContext.sharedPreferences.edit().putString("sif", latestVersion).apply()
remoteSideContext.log.info("sif updated to $latestVersion")
remoteSideContext.sharedPreferences.edit().putString("sif", latestVersion).commit()
remoteSideContext.shortToast("SIF updated to $latestVersion!")
// force restart snapchat
remoteSideContext.bridgeService?.stopSelf()
} else {

View File

@@ -78,7 +78,7 @@ class RemoteSideContext(
val tracker = RemoteTracker(this)
val accountStorage = RemoteAccountStorage(this)
val locationManager = RemoteLocationManager(this)
private val remoteSharedLibraryManager = RemoteSharedLibraryManager(this)
val remoteSharedLibraryManager = RemoteSharedLibraryManager(this)
//used to load bitmoji selfies and download previews
val imageLoader by lazy {

View File

@@ -10,6 +10,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import kotlinx.coroutines.launch
import me.rhunk.snapenhance.ui.setup.screens.SetupScreen
class SecurityScreen : SetupScreen() {
@@ -63,7 +64,10 @@ class SecurityScreen : SetupScreen() {
) {
Button(
onClick = {
context.sharedPreferences.edit().putString("sif", "").apply()
context.coroutineScope.launch {
context.sharedPreferences.edit().putString("sif", "").commit()
context.remoteSharedLibraryManager.init()
}
goNext()
}
) {