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

This commit is contained in:
Luca Auer
2026-02-20 21:09:00 +06:00
committed by GitHub
parent 7c7d35e2c6
commit e6cc38de06
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(