Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat: rename an environment so accounts on one machine can be told apart #25512

ClosedJolymmiles(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/25512/headopened View on GitHub

Showing 30 changed files with 13 additions and 9 deletions (loading 27).

x
0 of 30 viewed, 30 left
1 addition and 1 deletionapps/mobile/src/features/connection/ConnectionDiagnosisDetails.tsxModified
View file
@@ -38,7 +38,7 @@
const relayOnly =
connectionRoutes(presentation.entry).length === 1 && hasRelayRoute(presentation.entry);
const diagnosis = presentConnectionDiagnosis({
- hostLabel: presentation.entry.target.label,
+ hostLabel: presentation.label,
state,
via: relayOnly ? "relay" : "direct",
clientVersion: Constants.expoConfig?.version,
7 additions and 4 deletionsapps/mobile/src/features/connection/ConnectionEnvironmentRow.tsxModified
View file
@@ -49,15 +49,18 @@
updates: { readonly label: string; readonly displayUrl: string },
) => Promise<AtomCommandResult<unknown, unknown>>;
}) {
- const [label, setLabel] = useState(props.environment.environmentLabel);
+ const presentation = useAtomValue(
+ environmentPresentations.presentationAtom(props.environment.environmentId),
+ );
+ // Edit the saved label; the displayed one may be the environment's own custom name.
+ const [label, setLabel] = useState(
+ presentation?.entry.target.label ?? props.environment.environmentLabel,
+ );
const [url, setUrl] = useState(props.environment.displayUrl);
const serverConfig = useAtomValue(
serverEnvironment.configValueAtom(props.environment.environmentId),
);
const unsupported = props.environment.connectionState === "unsupported";