fix(mobile): block incompatible server connections (#11974)
This commit is contained in:
1 parent
e6ae764f47
commit
2c16c1d264
20 files changed
+234
-22
No files matched your search
@@ -11,6 +11,7 @@ export function connectionPhaseDotClassName(phase: EnvironmentConnectionPhase):
|
||||
case "connecting":
|
||||
case "reconnecting":
|
||||
return "bg-warning";
|
||||
case "unsupported":
|
||||
case "error":
|
||||
return "bg-destructive";
|
||||
default:
|
||||
|
||||
@@ -29,6 +29,7 @@ function normalizeConnectionState(phase: string | undefined): EnvironmentUpdateC
|
||||
case "connecting":
|
||||
case "reconnecting":
|
||||
return "connecting";
|
||||
case "unsupported":
|
||||
case "error":
|
||||
return "error";
|
||||
case "offline":
|
||||
|
||||
@@ -36,9 +36,11 @@ export function presentSavedCloudEnvironmentConnection(
|
||||
statusText: connectionStatusText(connection),
|
||||
tone: "connecting",
|
||||
};
|
||||
case "unsupported":
|
||||
case "error":
|
||||
return {
|
||||
buttonLabel: "Connection failed",
|
||||
buttonLabel:
|
||||
connection.phase === "unsupported" ? "Client not supported" : "Connection failed",
|
||||
statusText: connectionStatusText(connection),
|
||||
tone: "error",
|
||||
};
|
||||
|
||||
@@ -1456,6 +1456,8 @@ function savedBackendStatus(environment: EnvironmentPresentation): {
|
||||
text: connection.error ? `Reconnecting: ${connection.error}` : "Reconnecting",
|
||||
tone: "error",
|
||||
};
|
||||
case "unsupported":
|
||||
return { text: "Client not supported", tone: "error" };
|
||||
case "error":
|
||||
return {
|
||||
text: connection.error ? `Connection failed: ${connection.error}` : "Connection failed",
|
||||
|
||||
Reference in new issue
Block a user