From 4c67819ee29bd8801f0aa8b7273c1c9b4f430047 Mon Sep 17 00:00:00 2001 From: Abhishek Date: Sun, 21 Jul 2019 11:16:28 -0700 Subject: [PATCH] Extra validation! --- Clocker/Panel/Data Layer/TimezoneData.swift | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Clocker/Panel/Data Layer/TimezoneData.swift b/Clocker/Panel/Data Layer/TimezoneData.swift index 73afe5c..3adcf5f 100644 --- a/Clocker/Panel/Data Layer/TimezoneData.swift +++ b/Clocker/Panel/Data Layer/TimezoneData.swift @@ -252,7 +252,11 @@ class TimezoneData: NSObject, NSCoding { newModels.append(newModel) } } - + + if UserDefaults.standard.object(forKey: "shouldOverrideSecondsFormatBug") == nil { + UserDefaults.standard.set("YES", forKey: "shouldOverrideSecondsFormatBug") + } + // Do the serialization let serializedModels = newModels.map { (place) -> Data in NSKeyedArchiver.archivedData(withRootObject: place) @@ -262,10 +266,8 @@ class TimezoneData: NSObject, NSCoding { } private class func shouldOverrideSecondsFormatBugFix(model: TimezoneData) { - if UserDefaults.standard.object(forKey: "shouldOverrideSecondsFormatBugFix") == nil { + if UserDefaults.standard.object(forKey: "shouldOverrideSecondsFormatBug") == nil { model.setShouldOverrideSecondsFormat(2) - UserDefaults.standard.set("YES", forKey: "shouldOverrideSecondsFormatBugFix") - return } }