diff --git a/Examples/xx-messenger/Sources/AppFeature/AppEnvironment+Live.swift b/Examples/xx-messenger/Sources/AppFeature/AppEnvironment+Live.swift index a81b863afa2015e6a7d699ba5c921e0dc810e457..3cf2cb0b065eda90aeff16cf1ce76f14297fd012 100644 --- a/Examples/xx-messenger/Sources/AppFeature/AppEnvironment+Live.swift +++ b/Examples/xx-messenger/Sources/AppFeature/AppEnvironment+Live.swift @@ -28,7 +28,7 @@ extension AppEnvironment { handleConfirm: .live(db: dbManager.getDB), handleReset: .live(db: dbManager.getDB) ) - let backupStorage = BackupStorage.live(now: Date.init) + let backupStorage = BackupStorage.onDisk() let mainQueue = DispatchQueue.main.eraseToAnyScheduler() let bgQueue = DispatchQueue.global(qos: .background).eraseToAnyScheduler() diff --git a/Examples/xx-messenger/Sources/AppFeature/AppFeature.swift b/Examples/xx-messenger/Sources/AppFeature/AppFeature.swift index 145da90778e70bd67c93ea6eae868bd4a5bb97e2..07be9948b695eb3bb8ecda07fb674ca77e8e7141 100644 --- a/Examples/xx-messenger/Sources/AppFeature/AppFeature.swift +++ b/Examples/xx-messenger/Sources/AppFeature/AppFeature.swift @@ -97,7 +97,7 @@ let appReducer = Reducer<AppState, AppAction, AppEnvironment> env.log(.error(error as NSError)) })) cancellables.append(env.messenger.registerBackupCallback(.init { data in - env.backupStorage.store(data) + try? env.backupStorage.store(data) })) let isLoaded = env.messenger.isLoaded() diff --git a/Examples/xx-messenger/Sources/BackupFeature/BackupFeature.swift b/Examples/xx-messenger/Sources/BackupFeature/BackupFeature.swift index 128c375b2625193e207a2c3f0ef50b96d00a3ac7..e1ce8fb201188ac101249d070dc96a75e4ca481a 100644 --- a/Examples/xx-messenger/Sources/BackupFeature/BackupFeature.swift +++ b/Examples/xx-messenger/Sources/BackupFeature/BackupFeature.swift @@ -166,7 +166,7 @@ public let backupReducer = Reducer<BackupState, BackupAction, BackupEnvironment> return Effect.run { subscriber in do { try env.messenger.stopBackup() - env.backupStorage.remove() + try env.backupStorage.remove() subscriber.send(.didStop(failure: nil)) } catch { subscriber.send(.didStop(failure: error as NSError))