Skip to content

Commit ba41414

Browse files
refactor(client-runtime): remove unused connection phase message
1 parent d2c3e2e commit ba41414

2 files changed

Lines changed: 1 addition & 28 deletions

File tree

‎packages/client-runtime/src/connection/presentation.test.ts‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
} from "./model.ts";
1111
import {
1212
connectionCatalogDisplayUrl,
13-
connectionPhaseMessage,
1413
connectionStatusText,
1514
connectionStatusTitle,
1615
presentEnvironmentConnection,
@@ -119,10 +118,6 @@ describe("connection presentation", () => {
119118
});
120119
});
121120

122-
it("gives offline status precedence in global messaging", () => {
123-
expect(connectionPhaseMessage("connected", TARGET.label, "offline")).toBe("You are offline");
124-
});
125-
126121
it("combines reconnect progress with the latest failure", () => {
127122
const connection = {
128123
phase: "reconnecting",

‎packages/client-runtime/src/connection/presentation.ts‎

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import type { ServerConfig } from "@t3tools/contracts";
22
import * as Option from "effect/Option";
33

44
import type { ConnectionCatalogEntry } from "./catalog.ts";
5-
import type { NetworkStatus, SupervisorConnectionState } from "./model.ts";
5+
import type { SupervisorConnectionState } from "./model.ts";
66

77
export type EnvironmentConnectionPhase =
88
| "available"
@@ -105,25 +105,3 @@ export function connectionCatalogDisplayUrl(entry: ConnectionCatalogEntry): stri
105105
: null;
106106
}
107107
}
108-
109-
export function connectionPhaseMessage(
110-
phase: EnvironmentConnectionPhase,
111-
label: string,
112-
networkStatus: NetworkStatus,
113-
): string {
114-
if (networkStatus === "offline" || phase === "offline") {
115-
return "You are offline";
116-
}
117-
switch (phase) {
118-
case "available":
119-
return "Available";
120-
case "connecting":
121-
return `Connecting to ${label}...`;
122-
case "reconnecting":
123-
return `Reconnecting to ${label}...`;
124-
case "connected":
125-
return "Connected";
126-
case "error":
127-
return "Connection failed";
128-
}
129-
}

0 commit comments

Comments
 (0)