Reapply "Fix cache invalidation isn't done at startup (#2970)"

This reverts commit d219c5e3bb.
This commit is contained in:
AntsyLich
2026-02-26 18:43:03 +06:00
parent 0024278f4b
commit 81871a3469
2 changed files with 41 additions and 18 deletions
@@ -176,6 +176,7 @@ object SettingsAdvancedScreen : SearchableSettings {
private fun getDataGroup(): Preference.PreferenceGroup {
val context = LocalContext.current
val navigator = LocalNavigator.currentOrThrow
val scope = rememberCoroutineScope()
return Preference.PreferenceGroup(
title = stringResource(MR.strings.label_data),
@@ -184,8 +185,10 @@ object SettingsAdvancedScreen : SearchableSettings {
title = stringResource(MR.strings.pref_invalidate_download_cache),
subtitle = stringResource(MR.strings.pref_invalidate_download_cache_summary),
onClick = {
Injekt.get<DownloadCache>().invalidateCache()
context.toast(MR.strings.download_cache_invalidated)
scope.launch {
Injekt.get<DownloadCache>().invalidateCache()
context.toast(MR.strings.download_cache_invalidated)
}
},
),
Preference.PreferenceItem.TextPreference(