From 8bd5111390fb680009d08d6766403dc08c8a7aaf Mon Sep 17 00:00:00 2001 From: Suphon Thanakornpakapong Date: Tue, 19 Oct 2021 19:08:20 +0700 Subject: [PATCH] Only reload grid if user actually changed the title --- .../app/lawnchair/override/CustomizeDialog.kt | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/lawnchair/src/app/lawnchair/override/CustomizeDialog.kt b/lawnchair/src/app/lawnchair/override/CustomizeDialog.kt index 442b980fef..200d772b15 100644 --- a/lawnchair/src/app/lawnchair/override/CustomizeDialog.kt +++ b/lawnchair/src/app/lawnchair/override/CustomizeDialog.kt @@ -98,11 +98,18 @@ fun CustomizeAppDialog( DisposableEffect(key1 = null) { title = prefs.customAppName[componentKey] ?: "" onDispose { - prefs.customAppName[componentKey] = title.ifEmpty { null } - val las = LauncherAppState.getInstance(context) - val idp = las.invariantDeviceProfile - las.iconCache.updateIconsForPkg(componentKey.componentName.packageName, componentKey.user) - context.launcher.onIdpChanged(idp) + val previousTitle = prefs.customAppName[componentKey] + val newTitle = title.ifEmpty { null } + if (newTitle != previousTitle) { + prefs.customAppName[componentKey] = newTitle + val las = LauncherAppState.getInstance(context) + val idp = las.invariantDeviceProfile + las.iconCache.updateIconsForPkg( + componentKey.componentName.packageName, + componentKey.user + ) + context.launcher.onIdpChanged(idp) + } } } CustomizeDialog(