From b532cf87edd5676184d17c2bf6f6c23888abb5af Mon Sep 17 00:00:00 2001 From: 5ec1cff Date: Tue, 14 Jan 2025 21:24:31 +0800 Subject: [PATCH] PropertiesActivity: do not ask if profile not modified --- .../main/java/com/github/kr328/clash/PropertiesActivity.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/github/kr328/clash/PropertiesActivity.kt b/app/src/main/java/com/github/kr328/clash/PropertiesActivity.kt index feb99eb2..62adc8bc 100644 --- a/app/src/main/java/com/github/kr328/clash/PropertiesActivity.kt +++ b/app/src/main/java/com/github/kr328/clash/PropertiesActivity.kt @@ -16,6 +16,7 @@ import com.github.kr328.clash.design.R class PropertiesActivity : BaseActivity() { private var canceled: Boolean = false + private lateinit var original: Profile override suspend fun main() { setResult(RESULT_CANCELED) @@ -23,7 +24,7 @@ class PropertiesActivity : BaseActivity() { val uuid = intent.uuid ?: return finish() val design = PropertiesDesign(this) - val original = withProfile { queryByUUID(uuid) } ?: return finish() + original = withProfile { queryByUUID(uuid) } ?: return finish() design.profile = original @@ -72,7 +73,7 @@ class PropertiesActivity : BaseActivity() { design?.apply { launch { if (!progressing) { - if (requestExitWithoutSaving()) + if (original == profile || requestExitWithoutSaving()) finish() } }