File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed
Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -228,6 +228,7 @@ public class KeychainValue<T: Codable & Equatable> {
228228 // If the new value is equal to the default value, remove the corresponding entry from the Keychain.
229229 do {
230230 try keychain. remove ( key)
231+ valueSubject. send ( newValue)
231232 } catch {
232233 GoodPersistence . log ( message: " Setting keychain value [ \( defaultValue) ] for key [ \( key) ] not performed. Reason: Removing from keychain failed. " )
233234 throw error
@@ -239,15 +240,11 @@ public class KeychainValue<T: Codable & Equatable> {
239240 do {
240241 // Encoding the wrapped value.
241242 let data = try JSONEncoder ( ) . encode ( wrapper)
242- do {
243- // Storing data in the Keychain using the specified key
244- try keychain. set ( data, key: key)
245- } catch {
246- GoodPersistence . log ( message: " Setting keychain value [ \( defaultValue) ] for key [ \( key) ] not performed. Reason: Data encoding failed. " )
247- throw error
248- }
243+ // Storing data in the Keychain using the specified key
244+ try keychain. set ( data, key: key)
245+ valueSubject. send ( newValue)
249246 } catch {
250- GoodPersistence . log ( message: " Setting keychain value [ \( defaultValue ) ] for key [ \( key) ] not performed. Reason: Data encoding failed. " )
247+ GoodPersistence . log ( message: " Setting keychain value [ \( newValue ) ] for key [ \( key) ] not performed. Reason: Data encoding failed. " )
251248 throw error
252249 }
253250 GoodPersistence . log ( message: " Keychain Data for key [ \( key) ] has changed to \( newValue) . " )
You can’t perform that action at this time.
0 commit comments