Add back always on option

This commit is contained in:
世界 committed 2024-04-06 23:58:59 +08:00
1 parent db8cbfa865
commit debd0ca1a2
8 files changed
+94 -25

No files matched your search

+8 -2
View File
@@ -9,8 +9,6 @@ public enum SharedPreferences {
private static let ignoreMemoryLimitByDefault = false
#endif
public static let alwaysOn = Preference<Bool>("always_on", defaultValue: false)
public static let ignoreMemoryLimit = Preference<Bool>("ignore_memory_limit", defaultValue: ignoreMemoryLimitByDefault)
#if os(iOS)
@@ -70,6 +68,14 @@ public enum SharedPreferences {
await excludeAPNsRoute.set(nil)
}
// On Demand Rules
public static let alwaysOn = Preference<Bool>("always_on", defaultValue: false)
public static func resetOnDemandRules() async {
await alwaysOn.set(nil)
}
#if DEBUG
public static let inDebug = true
#else