Sync Home with pull then push and prepare 1.0.1 build 8 (#124)
Dependency security audit / rustsec (push) Successful in 20s
Tagged release / prepare-release (push) Successful in 4s
Tagged release / build-unix (push) Successful in 1h15m17s
Tagged release / build-windows (push) Successful in 19m26s
Tagged release / publish-release (push) Successful in 3s
Dependency security audit / rustsec (push) Successful in 20s
Tagged release / prepare-release (push) Successful in 4s
Tagged release / build-unix (push) Successful in 1h15m17s
Tagged release / build-windows (push) Successful in 19m26s
Tagged release / publish-release (push) Successful in 3s
This commit is contained in:
1 parent
3c3574b449
commit
aec3f237a9
12 files changed
+1174
-50
No files matched your search
@@ -388,9 +388,11 @@ private final class ShellViewController: UITableViewController, MobileTabRoot {
|
||||
case fetch
|
||||
case pull
|
||||
case push
|
||||
case sync
|
||||
|
||||
var changesLocalStore: Bool {
|
||||
if case .pull = self { return true }
|
||||
if case .sync = self { return true }
|
||||
return false
|
||||
}
|
||||
}
|
||||
@@ -577,7 +579,7 @@ private final class ShellViewController: UITableViewController, MobileTabRoot {
|
||||
refreshControl?.endRefreshing()
|
||||
return
|
||||
}
|
||||
runHome(.pull)
|
||||
runHome(.sync)
|
||||
} else {
|
||||
reloadShell()
|
||||
}
|
||||
@@ -750,7 +752,7 @@ private final class ShellViewController: UITableViewController, MobileTabRoot {
|
||||
let refreshed = page.refreshedAt.map(formattedDate)
|
||||
switch page.freshness {
|
||||
case .neverRefreshed:
|
||||
return "Not refreshed. Pull down to update the local clone or tap Refresh Status."
|
||||
return "Not refreshed. Pull down to pull, then push your changes, or tap Refresh Status."
|
||||
case .cached:
|
||||
return "Cached · Last refreshed \(refreshed ?? "at an unknown time"). This is not live status."
|
||||
case .current:
|
||||
@@ -822,6 +824,7 @@ private final class ShellViewController: UITableViewController, MobileTabRoot {
|
||||
case .fetch: try operation.fetch()
|
||||
case .pull: try operation.pull()
|
||||
case .push: try operation.push()
|
||||
case .sync: try operation.sync()
|
||||
}
|
||||
return Result<MobileHomePage, HomeFailure>.success(page)
|
||||
} catch let error as MobileHomeFfiError {
|
||||
@@ -865,11 +868,16 @@ private final class ShellViewController: UITableViewController, MobileTabRoot {
|
||||
UIAccessibility.post(notification: .announcement, argument: notice.title)
|
||||
}
|
||||
case let .failure(failure):
|
||||
if request == .sync {
|
||||
// Pull may have updated entries before a later push failed.
|
||||
NotificationCenter.default.post(name: .ironStorageLocalStoreDidChange, object: nil)
|
||||
NotificationCenter.default.post(name: .ironStorageWatchSnapshotDidChange, object: nil)
|
||||
}
|
||||
tableView.reloadData()
|
||||
if homePage == nil {
|
||||
showHomeFailure(failure)
|
||||
presentHomeFailure(failure, retry: request ?? .fetch)
|
||||
} else if failure.kind == .interrupted {
|
||||
} else if failure.kind == .interrupted, request != .sync {
|
||||
UIAccessibility.post(notification: .announcement, argument: failure.title)
|
||||
} else {
|
||||
presentHomeFailure(failure, retry: request ?? .fetch)
|
||||
|
||||
Reference in new issue
Block a user