|
3 | 3 |
|
4 | 4 | import Logo from "@/app/asset/logo.svg"; |
5 | 5 | import { OnboardingGradientBg } from "@/app/onboarding/onboarding-common"; |
| 6 | +import { atoms } from "@/app/store/global"; |
6 | 7 | import { modalsModel } from "@/app/store/modalmodel"; |
7 | 8 | import { RpcApi } from "@/app/store/wshclientapi"; |
8 | 9 | import { TabRpcClient } from "@/app/store/wshrpcutil"; |
9 | 10 | import { isDev } from "@/util/isdev"; |
10 | 11 | import { fireAndForget } from "@/util/util"; |
11 | | -import { useEffect, useState } from "react"; |
12 | | -import { getApi } from "../store/global"; |
| 12 | +import { useAtomValue } from "jotai"; |
| 13 | +import { useEffect } from "react"; |
13 | 14 | import { Modal } from "./modal"; |
14 | 15 |
|
15 | 16 | interface AboutModalVProps { |
@@ -84,9 +85,9 @@ const AboutModalV = ({ versionString, updaterChannel, onClose }: AboutModalVProp |
84 | 85 | AboutModalV.displayName = "AboutModalV"; |
85 | 86 |
|
86 | 87 | const AboutModal = () => { |
87 | | - const [details] = useState(() => getApi().getAboutModalDetails()); |
88 | | - const [updaterChannel] = useState(() => getApi().getUpdaterChannel()); |
89 | | - const versionString = `${details.version} (${isDev() ? "dev-" : ""}${details.buildTime})`; |
| 88 | + const fullConfig = useAtomValue(atoms.fullConfigAtom); |
| 89 | + const versionString = `${fullConfig?.version ?? ""} (${isDev() ? "dev-" : ""}${fullConfig?.buildtime ?? ""})`; |
| 90 | + const updaterChannel = fullConfig?.settings?.["autoupdate:channel"] ?? "latest"; |
90 | 91 |
|
91 | 92 | useEffect(() => { |
92 | 93 | fireAndForget(async () => { |
|
0 commit comments