mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-11 07:43:28 +01:00
improve: move Reset Image Cache to Dev Mode
This commit is contained in:
@@ -59,7 +59,6 @@
|
||||
"SettingsView.addToSiri" = "Add to Siri...";
|
||||
"SettingsView.refreshingApps" = "Refreshing Apps";
|
||||
"SettingsView.switchToUIKit" = "Switch to UIKit";
|
||||
"SettingsView.resetImageCache" = "Reset Image Cache";
|
||||
"SettingsView.debug" = "Debug";
|
||||
"SettingsView.swiftUIRedesign" = "SwiftUI Redesign";
|
||||
"SettingsView.credits" = "Credits";
|
||||
@@ -198,6 +197,7 @@ You should only enable Developer Mode if you meet one of the following requireme
|
||||
"DevModeView.General.header" = "General";
|
||||
"DevModeView.General.console" = "Console";
|
||||
"DevModeView.General.unstableFeaturesNightlyOnly" = "Unstable Features are only available on nightly builds, PR builds and debug builds.";
|
||||
"DevModeView.General.resetImageCache" = "Reset Image Cache";
|
||||
"DevModeView.General.disableDevMode" = "Disable Developer Mode";
|
||||
"DevModeView.Files.header" = "Files";
|
||||
"DevModeView.Files.dataExplorer" = "Data File Explorer";
|
||||
|
||||
@@ -292,6 +292,8 @@ internal enum L10n {
|
||||
internal static let disableDevMode = L10n.tr("Localizable", "DevModeView.General.disableDevMode", fallback: "Disable Developer Mode")
|
||||
/// General
|
||||
internal static let header = L10n.tr("Localizable", "DevModeView.General.header", fallback: "General")
|
||||
/// Reset Image Cache
|
||||
internal static let resetImageCache = L10n.tr("Localizable", "DevModeView.General.resetImageCache", fallback: "Reset Image Cache")
|
||||
/// Unstable Features are only available on nightly builds, PR builds and debug builds.
|
||||
internal static let unstableFeaturesNightlyOnly = L10n.tr("Localizable", "DevModeView.General.unstableFeaturesNightlyOnly", fallback: "Unstable Features are only available on nightly builds, PR builds and debug builds.")
|
||||
}
|
||||
@@ -438,8 +440,6 @@ internal enum L10n {
|
||||
internal static let refreshingAppsFooter = L10n.tr("Localizable", "SettingsView.refreshingAppsFooter", fallback: "Enable Background Refresh to automatically refresh apps in the background when connected to WiFi and with Wireguard active.")
|
||||
/// Reset adi.pb
|
||||
internal static let resetAdiPb = L10n.tr("Localizable", "SettingsView.resetAdiPb", fallback: "Reset adi.pb")
|
||||
/// Reset Image Cache
|
||||
internal static let resetImageCache = L10n.tr("Localizable", "SettingsView.resetImageCache", fallback: "Reset Image Cache")
|
||||
/// Reset Pairing File
|
||||
internal static let resetPairingFile = L10n.tr("Localizable", "SettingsView.resetPairingFile", fallback: "Reset Pairing File")
|
||||
/// Show Error Log
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -199,9 +199,6 @@ struct SettingsView: View {
|
||||
}
|
||||
}
|
||||
|
||||
SwiftUI.Button(L10n.SettingsView.resetImageCache, action: self.resetImageCache)
|
||||
.foregroundColor(.red)
|
||||
|
||||
SwiftUI.Button(L10n.SettingsView.resetPairingFile) {
|
||||
self.isShowingResetPairingFileConfirmation = true
|
||||
}
|
||||
@@ -303,19 +300,6 @@ struct SettingsView: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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)")
|
||||
}
|
||||
}
|
||||
|
||||
func resetPairingFile() {
|
||||
let filename = "ALTPairingFile.mobiledevicepairing"
|
||||
|
||||
Reference in New Issue
Block a user