diff --git a/app/src/main/kotlin/me/rhunk/snapenhance/RemoteSharedLibraryManager.kt b/app/src/main/kotlin/me/rhunk/snapenhance/RemoteSharedLibraryManager.kt index b3fc1825..ea4cc601 100644 --- a/app/src/main/kotlin/me/rhunk/snapenhance/RemoteSharedLibraryManager.kt +++ b/app/src/main/kotlin/me/rhunk/snapenhance/RemoteSharedLibraryManager.kt @@ -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 { diff --git a/app/src/main/kotlin/me/rhunk/snapenhance/RemoteSideContext.kt b/app/src/main/kotlin/me/rhunk/snapenhance/RemoteSideContext.kt index be61d155..f89e8513 100644 --- a/app/src/main/kotlin/me/rhunk/snapenhance/RemoteSideContext.kt +++ b/app/src/main/kotlin/me/rhunk/snapenhance/RemoteSideContext.kt @@ -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 { diff --git a/app/src/main/kotlin/me/rhunk/snapenhance/ui/setup/screens/impl/SecurityScreen.kt b/app/src/main/kotlin/me/rhunk/snapenhance/ui/setup/screens/impl/SecurityScreen.kt index 43d90b82..d98467b1 100644 --- a/app/src/main/kotlin/me/rhunk/snapenhance/ui/setup/screens/impl/SecurityScreen.kt +++ b/app/src/main/kotlin/me/rhunk/snapenhance/ui/setup/screens/impl/SecurityScreen.kt @@ -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() } ) {