Store sessions as dictionary

This commit is contained in:
Ivan Grachyov 2021-07-11 16:55:37 +03:00
parent 35a71141b7
commit a61e0ede2b

View File

@ -6,9 +6,9 @@ struct Defaults {
private static let userDefaults = UserDefaults.standard
static var storedSessions: [SessionStorage.Item] {
static var storedSessions: [String: SessionStorage.Item] {
get {
return userDefaults.codableValue(type: [SessionStorage.Item].self, forKey: "storedSessions") ?? []
return userDefaults.codableValue(type: [String: SessionStorage.Item].self, forKey: "storedSessions") ?? [:]
}
set {
userDefaults.setCodable(newValue, forKey: "storedSessions")