feat: add desktop build using wails

This commit is contained in:
2024-11-16 02:34:07 +07:00
parent f2c0ab0945
commit a07c72974f
69 changed files with 1603 additions and 137 deletions
+26 -2
View File
@@ -1,12 +1,36 @@
import React from "react";
import React, { useEffect, useState } from "react";
import { Redirect } from "expo-router";
import { useTermSession } from "@/stores/terminal-sessions";
import { useServer } from "@/stores/app";
import { setLocalServer, useServer } from "@/stores/app";
import { GetLocalServer } from "@/lib/wailsjs/go/main/App";
import { Spinner, View } from "tamagui";
export default function index() {
const { sessions, curSession } = useTermSession();
const [isPending, setPending] = useState(true);
const curServer = useServer();
useEffect(() => {
// load local server
(async function () {
try {
const url = await GetLocalServer();
if (url) {
setLocalServer(url);
}
} catch (_) {}
setPending(false);
})();
}, []);
if (isPending) {
return (
<View flex={1} alignItems="center" justifyContent="center">
<Spinner />
</View>
);
}
if (!curServer) {
return <Redirect href="/server" />;
}