add desktop api to front

This commit is contained in:
Anton Bracke
2022-02-22 16:57:56 +01:00
parent 1425513452
commit 4e243151dd
21 changed files with 174 additions and 67 deletions
+25
View File
@@ -0,0 +1,25 @@
<script lang="ts">
import { onDestroy, onMount } from "svelte";
import { useParams } from "svelte-navigator";
import { selectServer, servers } from "~/store";
import { api } from "~/lib/ipc";
const params = useParams();
params.subscribe((_params) => {
selectServer(_params.id);
});
onMount(async () => {
await selectServer($params.id);
});
onDestroy(async () => {
await api.showLocalApp();
});
$: server = $servers.find(({ _id }) => _id === $params.id);
</script>
<div class="hidden m-auto text-gray-400">Server: "{server.name}"</div>