From 1d36de0b32dbff2905cb27655702d09e9e5b9994 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihat=20Gu=CC=88ndu=CC=88z?= Date: Tue, 20 Jun 2023 14:44:55 +0200 Subject: [PATCH] Fix issue with persisted data format --- Sources/ReviewKit/ReviewKit.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/ReviewKit/ReviewKit.swift b/Sources/ReviewKit/ReviewKit.swift index a853f69..0aca89f 100644 --- a/Sources/ReviewKit/ReviewKit.swift +++ b/Sources/ReviewKit/ReviewKit.swift @@ -23,7 +23,7 @@ public enum ReviewKit { self.positiveEvents.append(PositiveEvent(date: Date(), weight: weight)) self.positiveEvents.removeAll { $0.date < Date().addingTimeInterval(.days(-self.criteria.eventsExpireAfterDays)) } - UserDefaults.standard.set(self.positiveEvents, forKey: "ReviewKit.positiveEvents") + UserDefaults.standard.set(self.positiveEvents.map(\.rawValue), forKey: "ReviewKit.positiveEvents") } static var positiveEvents: [PositiveEvent] = UserDefaults.standard