Skip to content
Snippets Groups Projects

Restore contacts from backup

2 files
+ 7
2
Compare changes
  • Side-by-side
  • Inline

Files

@@ -57,6 +57,7 @@ public let contactLookupReducer = Reducer<ContactLookupState, ContactLookupActio
@@ -57,6 +57,7 @@ public let contactLookupReducer = Reducer<ContactLookupState, ContactLookupActio
switch action {
switch action {
case .lookupTapped:
case .lookupTapped:
state.isLookingUp = true
state.isLookingUp = true
 
state.failure = nil
return Effect.result { [state] in
return Effect.result { [state] in
do {
do {
let contact = try env.messenger.lookupContact(id: state.id)
let contact = try env.messenger.lookupContact(id: state.id)
@@ -71,11 +72,12 @@ public let contactLookupReducer = Reducer<ContactLookupState, ContactLookupActio
@@ -71,11 +72,12 @@ public let contactLookupReducer = Reducer<ContactLookupState, ContactLookupActio
case .didLookup(_):
case .didLookup(_):
state.isLookingUp = false
state.isLookingUp = false
 
state.failure = nil
return .none
return .none
case .didFail(let error):
case .didFail(let error):
state.failure = error.localizedDescription
state.isLookingUp = false
state.isLookingUp = false
 
state.failure = error.localizedDescription
return .none
return .none
}
}
}
}
Loading