diff --git a/IceCubesApp/App/Tabs/Settings/SettingsTab.swift b/IceCubesApp/App/Tabs/Settings/SettingsTab.swift index 17e9ec34..7d0ea471 100644 --- a/IceCubesApp/App/Tabs/Settings/SettingsTab.swift +++ b/IceCubesApp/App/Tabs/Settings/SettingsTab.swift @@ -7,6 +7,7 @@ import Models import Network import SwiftUI import Timeline +import Nuke struct SettingsTabs: View { @Environment(\.dismiss) private var dismiss @@ -22,6 +23,7 @@ struct SettingsTabs: View { @State private var addAccountSheetPresented = false @State private var isEditingAccount = false + @State private var cachedRemoved = false @Binding var popToRootTab: Tab @@ -32,6 +34,7 @@ struct SettingsTabs: View { accountsSection generalSection otherSections + cacheSection } .scrollContentBackground(.hidden) .background(theme.secondaryBackgroundColor) @@ -272,4 +275,21 @@ struct SettingsTabs: View { .scrollContentBackground(.hidden) .background(theme.secondaryBackgroundColor) } + + private var cacheSection: some View { + Section("settings.section.cache") { + if cachedRemoved { + Text("action.done") + .transition(.move(edge: .leading)) + } else { + Button("settings.cache-media.clear", role: .destructive) { + ImagePipeline.shared.cache.removeAll() + withAnimation { + cachedRemoved = true + } + } + } + } + .listRowBackground(theme.primaryBackgroundColor) + } } diff --git a/IceCubesApp/Resources/Localization/be.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/be.lproj/Localizable.strings index 800f4207..226e0b0a 100644 --- a/IceCubesApp/Resources/Localization/be.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/be.lproj/Localizable.strings @@ -195,6 +195,9 @@ "settings.display.section.font" = "Шрыфт"; +"settings.section.cache" = "Cache"; +"settings.cache-media.clear" = "Clear Media Cache"; + // MARK: Tabs "tab.explore" = "Аглядзець"; "tab.federated" = "Аб'яднаны"; diff --git a/IceCubesApp/Resources/Localization/ca.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/ca.lproj/Localizable.strings index 556580fa..239dd71e 100644 --- a/IceCubesApp/Resources/Localization/ca.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/ca.lproj/Localizable.strings @@ -189,6 +189,9 @@ "settings.display.section.font" = "Font"; +"settings.section.cache" = "Cache"; +"settings.cache-media.clear" = "Clear Media Cache"; + // MARK: Tabs "tab.explore" = "Exploreu"; "tab.federated" = "Federat"; diff --git a/IceCubesApp/Resources/Localization/de.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/de.lproj/Localizable.strings index b1a9b99a..1950915b 100644 --- a/IceCubesApp/Resources/Localization/de.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/de.lproj/Localizable.strings @@ -187,6 +187,9 @@ "settings.display.section.font" = "Schriftart"; +"settings.section.cache" = "Cache"; +"settings.cache-media.clear" = "Clear Media Cache"; + "enum.expand-media.show" = "Alle zeigen"; "enum.expand-media.hide" = "Alle ausblenden"; "enum.expand-media.hide-sensitive" = "Sensible ausblenden"; diff --git a/IceCubesApp/Resources/Localization/en-GB.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/en-GB.lproj/Localizable.strings index 7b9d263e..610d6107 100644 --- a/IceCubesApp/Resources/Localization/en-GB.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/en-GB.lproj/Localizable.strings @@ -193,6 +193,9 @@ "settings.display.section.font" = "Font"; +"settings.section.cache" = "Cache"; +"settings.cache-media.clear" = "Clear Media Cache"; + // MARK: Tabs "tab.explore" = "Explore"; "tab.federated" = "Federated"; diff --git a/IceCubesApp/Resources/Localization/en.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/en.lproj/Localizable.strings index d85510c6..2858f7ed 100644 --- a/IceCubesApp/Resources/Localization/en.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/en.lproj/Localizable.strings @@ -191,6 +191,9 @@ "settings.display.section.font" = "Font"; +"settings.section.cache" = "Cache"; +"settings.cache-media.clear" = "Clear Media Cache"; + // MARK: Tabs "tab.explore" = "Explore"; "tab.federated" = "Federated"; diff --git a/IceCubesApp/Resources/Localization/es.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/es.lproj/Localizable.strings index fad3d32a..32798551 100644 --- a/IceCubesApp/Resources/Localization/es.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/es.lproj/Localizable.strings @@ -187,6 +187,9 @@ "settings.display.section.font" = "Fuente"; +"settings.section.cache" = "Cache"; +"settings.cache-media.clear" = "Clear Media Cache"; + "enum.expand-media.show" = "Siempre"; "enum.expand-media.hide" = "Nunca"; "enum.expand-media.hide-sensitive" = "Ocultar contenido sensible"; diff --git a/IceCubesApp/Resources/Localization/eu.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/eu.lproj/Localizable.strings index 4f9da46f..91782a03 100644 --- a/IceCubesApp/Resources/Localization/eu.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/eu.lproj/Localizable.strings @@ -187,6 +187,9 @@ "settings.display.section.font" = "Letra-tipoa"; +"settings.section.cache" = "Cache"; +"settings.cache-media.clear" = "Clear Media Cache"; + "enum.expand-media.show" = "Erakutsi guztia"; "enum.expand-media.hide" = "Ezkutatu guztia"; "enum.expand-media.hide-sensitive" = "Ezkutatu hunkigarria"; diff --git a/IceCubesApp/Resources/Localization/fr.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/fr.lproj/Localizable.strings index 2a4bd8a7..ed262ac0 100644 --- a/IceCubesApp/Resources/Localization/fr.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/fr.lproj/Localizable.strings @@ -190,6 +190,9 @@ "settings.display.section.font" = "Police"; +"settings.section.cache" = "Cache"; +"settings.cache-media.clear" = "Clear Media Cache"; + // MARK: Tabs "tab.explore" = "Explorer"; "tab.federated" = "Fédéré"; diff --git a/IceCubesApp/Resources/Localization/it.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/it.lproj/Localizable.strings index eab0a1b6..8d609a02 100644 --- a/IceCubesApp/Resources/Localization/it.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/it.lproj/Localizable.strings @@ -190,6 +190,9 @@ "settings.display.section.font" = "Font"; +"settings.section.cache" = "Cache"; +"settings.cache-media.clear" = "Clear Media Cache"; + // MARK: Tabs "tab.explore" = "Esplora"; "tab.federated" = "Federazione"; diff --git a/IceCubesApp/Resources/Localization/ja.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/ja.lproj/Localizable.strings index 2b4b6897..a3a38218 100644 --- a/IceCubesApp/Resources/Localization/ja.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/ja.lproj/Localizable.strings @@ -190,6 +190,9 @@ "settings.display.section.font" = "フォント"; +"settings.section.cache" = "Cache"; +"settings.cache-media.clear" = "Clear Media Cache"; + // MARK: Tabs "tab.explore" = "探索"; "tab.federated" = "連合"; diff --git a/IceCubesApp/Resources/Localization/ko.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/ko.lproj/Localizable.strings index 728d2183..63281193 100644 --- a/IceCubesApp/Resources/Localization/ko.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/ko.lproj/Localizable.strings @@ -190,6 +190,9 @@ "settings.display.section.font" = "글꼴"; +"settings.section.cache" = "Cache"; +"settings.cache-media.clear" = "Clear Media Cache"; + // MARK: Tabs "tab.explore" = "둘러보기"; "tab.federated" = "연합"; diff --git a/IceCubesApp/Resources/Localization/nb.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/nb.lproj/Localizable.strings index f19c5866..228b9c66 100644 --- a/IceCubesApp/Resources/Localization/nb.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/nb.lproj/Localizable.strings @@ -190,6 +190,9 @@ "settings.display.section.font" = "Font"; +"settings.section.cache" = "Cache"; +"settings.cache-media.clear" = "Clear Media Cache"; + // MARK: Tabs "tab.explore" = "Utforsk"; "tab.federated" = "Federert"; diff --git a/IceCubesApp/Resources/Localization/nl.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/nl.lproj/Localizable.strings index c1997086..5e569b50 100644 --- a/IceCubesApp/Resources/Localization/nl.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/nl.lproj/Localizable.strings @@ -187,6 +187,9 @@ "settings.display.section.font" = "Lettertype"; +"settings.section.cache" = "Cache"; +"settings.cache-media.clear" = "Clear Media Cache"; + // MARK: Tabs "tab.explore" = "Ontdekken"; "tab.federated" = "Gefedereerd"; diff --git a/IceCubesApp/Resources/Localization/pl.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/pl.lproj/Localizable.strings index cd6aff02..4ec4db5e 100644 --- a/IceCubesApp/Resources/Localization/pl.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/pl.lproj/Localizable.strings @@ -190,6 +190,9 @@ "settings.display.section.font" = "Czcionka"; +"settings.section.cache" = "Cache"; +"settings.cache-media.clear" = "Clear Media Cache"; + // MARK: Tabs "tab.explore" = "Odkrywaj"; "tab.federated" = "Globalny"; diff --git a/IceCubesApp/Resources/Localization/pt-BR.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/pt-BR.lproj/Localizable.strings index bbe621f9..54b08f8c 100644 --- a/IceCubesApp/Resources/Localization/pt-BR.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/pt-BR.lproj/Localizable.strings @@ -190,6 +190,9 @@ "settings.display.section.font" = "Fonte"; +"settings.section.cache" = "Cache"; +"settings.cache-media.clear" = "Clear Media Cache"; + // MARK: Tabs "tab.explore" = "Explorar"; "tab.federated" = "Linha global"; diff --git a/IceCubesApp/Resources/Localization/tr.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/tr.lproj/Localizable.strings index 716d2436..d0e95312 100644 --- a/IceCubesApp/Resources/Localization/tr.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/tr.lproj/Localizable.strings @@ -190,6 +190,9 @@ "settings.display.section.font" = "Font"; +"settings.section.cache" = "Cache"; +"settings.cache-media.clear" = "Clear Media Cache"; + // MARK: Tabs "tab.explore" = "Keşfet"; "tab.federated" = "Birleştirilmiş"; diff --git a/IceCubesApp/Resources/Localization/uk.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/uk.lproj/Localizable.strings index 510d0510..ede52ec8 100644 --- a/IceCubesApp/Resources/Localization/uk.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/uk.lproj/Localizable.strings @@ -191,6 +191,9 @@ "settings.display.section.font" = "Шрифти"; +"settings.section.cache" = "Cache"; +"settings.cache-media.clear" = "Clear Media Cache"; + // MARK: Tabs "tab.explore" = "Огляд"; "tab.federated" = "Глобальна"; diff --git a/IceCubesApp/Resources/Localization/zh-Hans.lproj/Localizable.strings b/IceCubesApp/Resources/Localization/zh-Hans.lproj/Localizable.strings index 4ae0ffdd..1e3d29d1 100644 --- a/IceCubesApp/Resources/Localization/zh-Hans.lproj/Localizable.strings +++ b/IceCubesApp/Resources/Localization/zh-Hans.lproj/Localizable.strings @@ -188,6 +188,9 @@ "settings.display.section.font" = "字体"; +"settings.section.cache" = "Cache"; +"settings.cache-media.clear" = "Clear Media Cache"; + // MARK: Tabs "tab.explore" = "探索"; "tab.federated" = "跨站";