refactor(client-runtime): remove unused connection phase message (#9972)
This commit is contained in:
1 parent
c1e279eca5
commit
1782a2af44
2 files changed
+1
-28
No files matched your search
@@ -10,7 +10,6 @@ import {
|
||||
} from "./model.ts";
|
||||
import {
|
||||
connectionCatalogDisplayUrl,
|
||||
connectionPhaseMessage,
|
||||
connectionStatusText,
|
||||
connectionStatusTitle,
|
||||
presentEnvironmentConnection,
|
||||
@@ -119,10 +118,6 @@ describe("connection presentation", () => {
|
||||
});
|
||||
});
|
||||
|
||||
it("gives offline status precedence in global messaging", () => {
|
||||
expect(connectionPhaseMessage("connected", TARGET.label, "offline")).toBe("You are offline");
|
||||
});
|
||||
|
||||
it("combines reconnect progress with the latest failure", () => {
|
||||
const connection = {
|
||||
phase: "reconnecting",
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { ServerConfig } from "@t3tools/contracts";
|
||||
import * as Option from "effect/Option";
|
||||
|
||||
import type { ConnectionCatalogEntry } from "./catalog.ts";
|
||||
import type { NetworkStatus, SupervisorConnectionState } from "./model.ts";
|
||||
import type { SupervisorConnectionState } from "./model.ts";
|
||||
|
||||
export type EnvironmentConnectionPhase =
|
||||
| "available"
|
||||
@@ -105,25 +105,3 @@ export function connectionCatalogDisplayUrl(entry: ConnectionCatalogEntry): stri
|
||||
: null;
|
||||
}
|
||||
}
|
||||
|
||||
export function connectionPhaseMessage(
|
||||
phase: EnvironmentConnectionPhase,
|
||||
label: string,
|
||||
networkStatus: NetworkStatus,
|
||||
): string {
|
||||
if (networkStatus === "offline" || phase === "offline") {
|
||||
return "You are offline";
|
||||
}
|
||||
switch (phase) {
|
||||
case "available":
|
||||
return "Available";
|
||||
case "connecting":
|
||||
return `Connecting to ${label}...`;
|
||||
case "reconnecting":
|
||||
return `Reconnecting to ${label}...`;
|
||||
case "connected":
|
||||
return "Connected";
|
||||
case "error":
|
||||
return "Connection failed";
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user