Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(web): import sessions from connected computers #22411

Closedahmetaydin35(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/22411/headopened View on GitHub

Showing 5 changed files with 78 additions and 1 deletion (loading 2).

x
0 of 5 viewed, 5 left
12 additions and 1 deletionapps/web/src/components/settings/SavedEnvironmentRows.tsxModified
View file
@@ -6,8 +6,10 @@
RouteIcon,
} from "lucide-react";
import { useAtomValue } from "@effect/atom-react";
+import { useNavigate } from "@tanstack/react-router";
import { useEffect, useEffectEvent, useState } from "react";
import {
+ AuthOrchestrationOperateScope,
AuthRelayWriteScope,
type EnvironmentId,
connectReachabilityHelpUrl,
@@ -55,7 +57,7 @@
import { useT3ConnectAccountPage } from "../clerk/T3ConnectAccountPages";
import { TunnelLimitAlert, TunnelUsageMeter } from "../cloud/TunnelUsage";
import { environmentCatalog } from "~/connection/catalog";
-import { readEnvironmentScope } from "~/state/session";
+import { readEnvironmentScope, useEnvironmentScope } from "~/state/session";
import { type EnvironmentPresentation, useRelayEnvironmentDiscovery } from "~/state/environments";
import { APP_VERSION } from "~/branding";
import { useManagedPolicy } from "~/state/managedPolicy";
@@ -124,6 +126,10 @@
const enabled = environment.entry.enabled && !unsupported;
const isConnected = environment.connection.phase === "connected";
const isRemoving = removingEnvironmentId === environmentId;
+ const navigate = useNavigate();
+ // Opens the Welcome page for this row's computer, which then scans that computer's history.
+ const canImportSessions =
+ useEnvironmentScope(environmentId, AuthOrchestrationOperateScope) && enabled && isConnected;