This commit is contained in:
Kylmakalle 2025-03-23 01:03:57 +02:00
parent b785dfa718
commit 6bd4f9465a

View File

@ -34,7 +34,7 @@ public func sgDBResetIfNeeded(databasePath: String, present: ((UIViewController)
} catch { } catch {
NSLog("[SG.DBReset] ERROR. Failed to reset database: \(error)") NSLog("[SG.DBReset] ERROR. Failed to reset database: \(error)")
let failAlert = UIAlertController( let failAlert = UIAlertController(
title: "ERROR. Failed to Reset Metadata", title: "ERROR. Failed to Reset database",
message: "\(error)", message: "\(error)",
preferredStyle: .alert preferredStyle: .alert
) )
@ -50,7 +50,7 @@ public func sgDBResetIfNeeded(databasePath: String, present: ((UIViewController)
public func sgHardReset(dataPath: String, present: ((UIViewController) -> ())?) { public func sgHardReset(dataPath: String, present: ((UIViewController) -> ())?) {
let startAlert = UIAlertController( let startAlert = UIAlertController(
title: "ATTENTION", title: "ATTENTION",
message: "Confirm HARD RESET?", message: "Confirm RESET ALL?",
preferredStyle: .alert preferredStyle: .alert
) )
@ -60,7 +60,7 @@ public func sgHardReset(dataPath: String, present: ((UIViewController) -> ())?)
startAlert.addAction(UIAlertAction(title: "RESET", style: .destructive) { _ in startAlert.addAction(UIAlertAction(title: "RESET", style: .destructive) { _ in
let ensureAlert = UIAlertController( let ensureAlert = UIAlertController(
title: "⚠️ ATTENTION ⚠️", title: "⚠️ ATTENTION ⚠️",
message: "ARE YOU SURE you want to make a HARD RESET?", message: "ARE YOU SURE you want to make a RESET ALL?",
preferredStyle: .alert preferredStyle: .alert
) )
@ -68,9 +68,9 @@ public func sgHardReset(dataPath: String, present: ((UIViewController) -> ())?)
exit(0) exit(0)
}) })
ensureAlert.addAction(UIAlertAction(title: "RESET NOW", style: .destructive) { _ in ensureAlert.addAction(UIAlertAction(title: "RESET NOW", style: .destructive) { _ in
NSLog("[SG.DBReset] Hard reset with system settings") NSLog("[SG.DBReset] Reset All with system settings")
let alert = UIAlertController( let alert = UIAlertController(
title: "Hard reset.\nPlease wait...", title: "Reset All.\nPlease wait...",
message: nil, message: nil,
preferredStyle: .alert preferredStyle: .alert
) )
@ -126,9 +126,9 @@ public func sgHardReset(dataPath: String, present: ((UIViewController) -> ())?)
} }
NSLog("[SG.DBReset] Done. Hard Reset completed") NSLog("[SG.DBReset] Done. Reset All completed")
let successAlert = UIAlertController( let successAlert = UIAlertController(
title: "Hard reset completed", title: "Reset All completed",
message: nil, message: nil,
preferredStyle: .alert preferredStyle: .alert
) )
@ -139,9 +139,9 @@ public func sgHardReset(dataPath: String, present: ((UIViewController) -> ())?)
present?(successAlert) present?(successAlert)
} }
} catch { } catch {
NSLog("[SG.DBReset] ERROR. Hard reset failed: \(error)") NSLog("[SG.DBReset] ERROR. Reset All failed: \(error)")
let failAlert = UIAlertController( let failAlert = UIAlertController(
title: "ERROR. Hard reset failed", title: "ERROR. Reset All failed",
message: "\(error)", message: "\(error)",
preferredStyle: .alert preferredStyle: .alert
) )