mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-14 17:23:25 +01:00
improve: move Reset Image Cache to Dev Mode
This commit is contained in:
@@ -159,6 +159,9 @@ struct DevModeMenu: View {
|
||||
.onTapGesture { isUnstableAlertShowing = true }
|
||||
#endif
|
||||
|
||||
SwiftUI.Button(L10n.DevModeView.General.resetImageCache, action: self.resetImageCache)
|
||||
.foregroundColor(.red)
|
||||
|
||||
SwiftUI.Button(action: {
|
||||
isDevModeEnabled = false
|
||||
}, label: { Text(L10n.DevModeView.General.disableDevMode) }).foregroundColor(.red)
|
||||
@@ -252,6 +255,19 @@ struct DevModeMenu: View {
|
||||
.navigationTitle(L10n.DevModeView.title)
|
||||
.enableInjection()
|
||||
}
|
||||
|
||||
func resetImageCache() {
|
||||
do {
|
||||
let url = try FileManager.default.url(
|
||||
for: .cachesDirectory,
|
||||
in: .userDomainMask,
|
||||
appropriateFor: nil,
|
||||
create: true)
|
||||
try FileManager.default.removeItem(at: url.appendingPathComponent("com.zeu.cache", isDirectory: true))
|
||||
} catch let error {
|
||||
fatalError("\(error)")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct DevModeView_Previews: PreviewProvider {
|
||||
|
||||
Reference in New Issue
Block a user