From 513d08998bd2399aea58005107a6c2bc7c8d4984 Mon Sep 17 00:00:00 2001 From: Zane Schepke Date: Mon, 23 Oct 2023 16:13:37 -0400 Subject: [PATCH] fix: config save bug Fixes a bug where config changes were saving on the wrong thread, causing a failure to save changes. Fixes a bug where the quick tile could cause a crash by initializing the tile state before it was ready. --- app/build.gradle.kts | 4 ++-- .../wireguardautotunnel/service/tile/TunnelControlTile.kt | 8 -------- .../wireguardautotunnel/ui/screens/config/ConfigScreen.kt | 2 +- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 9f0ad8e..cf13a73 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -14,8 +14,8 @@ android { applicationId = "com.zaneschepke.wireguardautotunnel" minSdk = 26 targetSdk = 34 - versionCode = 31600 - versionName = "3.1.6" + versionCode = 31700 + versionName = "3.1.7" multiDexEnabled = true diff --git a/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/tile/TunnelControlTile.kt b/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/tile/TunnelControlTile.kt index 9e5fb78..37eee62 100644 --- a/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/tile/TunnelControlTile.kt +++ b/app/src/main/java/com/zaneschepke/wireguardautotunnel/service/tile/TunnelControlTile.kt @@ -42,14 +42,6 @@ class TunnelControlTile : TileService() { super.onStartListening() } - override fun onTileAdded() { - super.onTileAdded() - qsTile.contentDescription = this.resources.getString(R.string.toggle_vpn) - scope.launch { - updateTileState() - } - } - override fun onTileRemoved() { super.onTileRemoved() cancelJob() diff --git a/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/config/ConfigScreen.kt b/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/config/ConfigScreen.kt index 6d15e36..ba9a9a2 100644 --- a/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/config/ConfigScreen.kt +++ b/app/src/main/java/com/zaneschepke/wireguardautotunnel/ui/screens/config/ConfigScreen.kt @@ -99,7 +99,7 @@ fun ConfigScreen( ) { val context = LocalContext.current - val scope = rememberCoroutineScope { Dispatchers.IO } + val scope = rememberCoroutineScope() val clipboardManager: ClipboardManager = LocalClipboardManager.current val keyboardController = LocalSoftwareKeyboardController.current