Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Re-check gateway provisioning status if sync fails but we DO have a gateway ID #1094

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 19 additions & 9 deletions xcode/Subconscious/Shared/Components/AppView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2130,17 +2130,27 @@ struct AppModel: ModelProtocol {
var model = state
model.lastGatewaySyncStatus = .failed(error)


var actions: [AppAction] = [
.indexOurSphere,
.toastStack(
.pushToast(
message: "Sync failed",
image: "exclamationmark.arrow.triangle.2.circlepath"
)
)
]

// If we have a gateway ID but sync failed then provisioning may have failed / timed out.
// Let's retry in-case it suddenly resolves the issue.
if let _ = state.gatewayId,
state.gatewayProvisioningStatus != .succeeded {
actions.append(.requestGatewayProvisioningStatus)
}

return update(
state: model,
actions: [
.indexOurSphere,
.toastStack(
.pushToast(
message: "Sync failed",
image: "exclamationmark.arrow.triangle.2.circlepath"
)
)
],
actions: actions,
environment: environment
).animation()
}
Expand Down
Loading