fix(mobile): allow stale environments to be deregistered #9761
ClosedRowan-Paul(GitHub profile, opens in a new tab)wants to merge 3 commits into
main fromrefs/pull/9761/headopened View on GitHubgithub-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched
github-actions[bot](GitHub profile, opens in a new tab) added labelssize:L
- apps/mobile/src/features/connection/CloudEnvironmentRows.tsx line 150OutdatedResolvedby Rowan-Paul(GitHub profile, opens in a new tab)@@ -111,0 +130,21 @@130+ [131+ { text: "Cancel", style: "cancel" },132+ {133+ text: "Deregister",134+ style: "destructive",135+ onPress: async () => {136+ if (!managedRelaySession) {137+ Alert.alert(138+ "Could not deregister environment",139+ "Sign in to T3 Connect before deregistering an environment.",140+ );141+ return;142+ }143+ setDeregisteringEnvironmentId(environment.environmentId);144+ const result = await deregisterEnvironment({145+ accountId: managedRelaySession.accountId,146+ environmentId: environment.environmentId,147+ });148+ setDeregisteringEnvironmentId(null);149+ if (AsyncResult.isSuccess(result)) {150+ await controller.refreshRelayEnvironments();apps/mobile/src/features/connection/CloudEnvironmentRows.tsx line 148OutdatedResolvedby macroscopeapp[bot](GitHub profile, opens in a new tab)@@ -111,0 +128,21 @@128+ "Deregister environment?",129+ `Remove ${environment.label} from your T3 Connect account? This revokes its T3 Connect access and removes its managed tunnel.`,130+ [131+ { text: "Cancel", style: "cancel" },132+ {133+ text: "Deregister",134+ style: "destructive",135+ onPress: async () => {136+ if (!managedRelaySession) {137+ Alert.alert(138+ "Could not deregister environment",139+ "Sign in to T3 Connect before deregistering an environment.",140+ );141+ return;142+ }143+ setDeregisteringEnvironmentId(environment.environmentId);144+ const result = await deregisterEnvironment({145+ accountId: managedRelaySession.accountId,146+ environmentId: environment.environmentId,147+ });148+ setDeregisteringEnvironmentId(null);
- apps/mobile/src/features/connection/CloudEnvironmentRows.tsx line 151OutdatedResolvedby cursor[bot](GitHub profile, opens in a new tab)@@ -111,0 +131,21 @@131+ { text: "Cancel", style: "cancel" },132+ {133+ text: "Deregister",134+ style: "destructive",135+ onPress: async () => {136+ if (!managedRelaySession) {137+ Alert.alert(138+ "Could not deregister environment",139+ "Sign in to T3 Connect before deregistering an environment.",140+ );141+ return;142+ }143+ setDeregisteringEnvironmentId(environment.environmentId);144+ const result = await deregisterEnvironment({145+ accountId: managedRelaySession.accountId,146+ environmentId: environment.environmentId,147+ });148+ setDeregisteringEnvironmentId(null);149+ if (AsyncResult.isSuccess(result)) {150+ await controller.refreshRelayEnvironments();151+ return;
juliusmarminge closed this
Sign in to join this conversation.


macroscopeapp[bot](GitHub profile, opens in a new tab) reviewed