Settings: Add an option to clean media cache
This commit is contained in:
parent
8e99c195e0
commit
cdbfd5db00
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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" = "Аб'яднаны";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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é";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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" = "連合";
|
||||
|
|
|
@ -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" = "연합";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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ş";
|
||||
|
|
|
@ -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" = "Глобальна";
|
||||
|
|
|
@ -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" = "跨站";
|
||||
|
|
Loading…
Reference in New Issue