File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed
Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -1199,9 +1199,13 @@ extension MigrationsService {
11991199// MARK: - RN Remote Backup Restore
12001200
12011201extension MigrationsService {
1202+ private func normalizePassphrase( _ passphrase: String ? ) -> String ? {
1203+ passphrase? . isEmpty == true ? nil : passphrase
1204+ }
1205+
12021206 func hasRNRemoteBackup( mnemonic: String , passphrase: String ? ) async -> Bool {
12031207 do {
1204- let effectivePassphrase = passphrase? . isEmpty == true ? nil : passphrase
1208+ let effectivePassphrase = normalizePassphrase ( passphrase)
12051209 RNBackupClient . shared. reset ( )
12061210 try await RNBackupClient . shared. setup ( mnemonic: mnemonic, passphrase: effectivePassphrase)
12071211 return try await RNBackupClient . shared. hasBackup ( )
@@ -1212,7 +1216,7 @@ extension MigrationsService {
12121216 }
12131217
12141218 func restoreFromRNRemoteBackup( mnemonic: String , passphrase: String ? ) async throws {
1215- let effectivePassphrase = passphrase? . isEmpty == true ? nil : passphrase
1219+ let effectivePassphrase = normalizePassphrase ( passphrase)
12161220 try await RNBackupClient . shared. setup ( mnemonic: mnemonic, passphrase: effectivePassphrase)
12171221
12181222 isRestoringFromRNRemoteBackup = true
Original file line number Diff line number Diff line change @@ -220,7 +220,11 @@ class RNBackupClient {
220220 else { continue }
221221
222222 let ts = UInt64 ( timestamp / 1000 ) // Convert ms to seconds
223- if latestTimestamp == nil || ts > latestTimestamp! {
223+ if let latest = latestTimestamp {
224+ if ts > latest {
225+ latestTimestamp = ts
226+ }
227+ } else {
224228 latestTimestamp = ts
225229 }
226230 }
You can’t perform that action at this time.
0 commit comments