Fixes for the sync state UI when errors occur

If syncing fails, the item is still saved so we don't change the
title.

When syncing fails make sure the red error cloud is shown.
This commit is contained in:
Jackson Harper 2022-06-02 21:36:28 -07:00
parent 975411d429
commit f54968d5d1
2 changed files with 4 additions and 4 deletions

View file

@ -166,12 +166,12 @@ class ExtensionSaveService {
}
} catch {
print("ERROR SYNCING", error)
updateStatus(newStatus: .syncFailed(error: SaveArticleError.unknown(description: "Unknown Error")))
return
}
state = .finished
updateStatus(newStatus: .synced)
state = .finished
}
}
}

View file

@ -156,11 +156,11 @@ public struct ShareExtensionChildView: View {
private var titleText: String {
switch viewModel.status {
case .saved, .synced:
case .saved, .synced, .syncFailed(error: _):
return "Saved to Omnivore"
case .processing:
return "Saving to Omnivore"
default:
case .failed(error: _):
return "Error saving to Omnivore"
}
}