Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mobile): update outdated servers and respect provider permissions #21402

Mergedmaria-rcksmerged 2 commits intomain fromrefs/pull/21402/headmerged by maria-rcks View on GitHub

Showing 8 changed files with 141 additions and 2 deletions (loading 6).

x
0 of 8 viewed, 8 left
129 additions and 0 deletionsapps/mobile/src/features/settings/OutdatedServerUpdateSection.tsxAdded
View file
@@ -0,0 +1,129 @@
+import { useAtomValue } from "@effect/atom-react";
+import { settlePromise, squashAtomCommandFailure } from "@t3tools/client-runtime/state/runtime";
+import type { EnvironmentId } from "@t3tools/contracts";
+import { AsyncResult } from "effect/reactivity";
+import { useEffect, useRef, useState } from "react";
+import { View } from "react-native";
+​
+import { AppText as Text } from "../../components/ui/AppText";
+import * as Dialog from "../../components/ui/Dialog";
+import {
+ describeOutdatedServer,
+ serverEnvironment,
+ updateOutdatedServer,
+} from "../../state/server";
+import { useAtomCommand } from "../../state/use-atom-command";
+import { SettingsActionRow } from "./components/SettingsActionRow";
+import { SettingsSection } from "./components/SettingsSection";
+import { findEnvironmentUpdate } from "./environment-maintenance";
+​
+export function OutdatedServerUpdateSection({
+ environmentId,
+ label,
+}: {
+ readonly environmentId: EnvironmentId;
+ readonly label: string;
+}) {
+ const describe = useAtomCommand(describeOutdatedServer, { reportFailure: false });
+ const update = useAtomCommand(updateOutdatedServer, { reportFailure: false });
+ const state = useAtomValue(serverEnvironment.updateStateAtom(environmentId));
+ const [release, setRelease] = useState<{