From 2b969030da173cec67abd80f17091bc4bcd82ba8 Mon Sep 17 00:00:00 2001 From: FooIbar <118464521+FooIbar@users.noreply.github.com> Date: Sun, 1 Sep 2024 17:28:50 +0800 Subject: [PATCH] Fix recent download label can't be set to `null` This reverts commit 822a461acd22e855f2c21c451c351ba14f421975. --- app/src/main/kotlin/com/hippo/ehviewer/Settings.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/kotlin/com/hippo/ehviewer/Settings.kt b/app/src/main/kotlin/com/hippo/ehviewer/Settings.kt index 2a8db80cb..fd5750942 100644 --- a/app/src/main/kotlin/com/hippo/ehviewer/Settings.kt +++ b/app/src/main/kotlin/com/hippo/ehviewer/Settings.kt @@ -123,7 +123,7 @@ object Settings : DataStorePreferences(null) { val security = boolPref("require_unlock", false) val animateItems = boolPref("animate_items", true) val displayName = stringOrNullPref("display_name", null) - val recentDownloadLabel = stringOrNullPref("recent_download_label", "") + val recentDownloadLabel = stringOrNullPref("recent_download_label", null) var downloadScheme by stringOrNullPref("image_scheme", null) var downloadAuthority by stringOrNullPref("image_authority", null) @@ -215,6 +215,9 @@ object Settings : DataStorePreferences(null) { if (KEY_SHOW_TAG_TRANSLATIONS !in prefs) showTagTranslations = true } } + if (downloadFilterMode.value == DownloadsFilterMode.ARTIST.flag && recentDownloadLabel.value == null) { + recentDownloadLabel.value = "" + } } interface Delegate {