Explorar o código

Persisted property fix

Ivan Valkou %!s(int64=4) %!d(string=hai) anos
pai
achega
89cf6fbb14

+ 3 - 1
FreeAPS/Sources/Helpers/PropertyWrappers/PersistedProperty.swift

@@ -43,6 +43,8 @@ import Foundation
         initialValue = wrappedValue
         lock?.lock()
         defer { lock?.unlock() }
-        setValue(storage.getValue(Value.self, forKey: key) ?? wrappedValue)
+        if storage.getValue(Value.self, forKey: key) == nil {
+            setValue(wrappedValue)
+        }
     }
 }