fixed : make sure to reload on icon changed

- closes : #5788
This commit is contained in:
MrSluffy
2025-09-06 14:10:16 +08:00
parent 1505e288d9
commit 4669ffe718
2 changed files with 6 additions and 3 deletions
@@ -148,6 +148,7 @@ fun CustomizeAppDialog(
var title by remember {
mutableStateOf(prefs.customAppName[componentKey] ?: defaultTitle)
}
val launcherAppState = LauncherAppState.getInstance(context)
val request = rememberLauncherForActivityResult(ActivityResultContracts.StartActivityForResult()) {
if (it.resultCode != Activity.RESULT_OK) return@rememberLauncherForActivityResult
@@ -168,7 +169,7 @@ fun CustomizeAppDialog(
val newTitle = if (title != defaultTitle) title else null
if (newTitle != previousTitle) {
prefs.customAppName[componentKey] = newTitle
val model = LauncherAppState.getInstance(context).model
val model = launcherAppState.model
model.onAppIconChanged(componentKey.componentName.packageName, componentKey.user)
}
}
@@ -39,7 +39,8 @@ fun SelectIconPreference(componentKey: ComponentKey) {
val iconPacks by LocalPreferenceInteractor.current.iconPacks.collectAsStateWithLifecycle()
val navController = LocalNavController.current
val scope = rememberCoroutineScope()
val model = LauncherAppState.getInstance(context).model
val launcherAppState = LauncherAppState.getInstance(context)
val model = launcherAppState.model
val repo = IconOverrideRepository.INSTANCE.get(context)
OnResult<IconPickerItem> { item ->
@@ -49,6 +50,7 @@ fun SelectIconPreference(componentKey: ComponentKey) {
it.setResult(Activity.RESULT_OK)
it.finish()
model.onAppIconChanged(componentKey.componentName.packageName, componentKey.user)
launcherAppState.reloadIcons()
}
}
}
@@ -68,7 +70,7 @@ fun SelectIconPreference(componentKey: ComponentKey) {
it.setResult(Activity.RESULT_OK)
it.finish()
model.onAppIconChanged(componentKey.componentName.packageName, componentKey.user)
LauncherAppState.INSTANCE.get(context).reloadIcons()
launcherAppState.reloadIcons()
}
}
},