mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2025-11-09 20:12:14 +10:00
45 lines
963 B
Vue
45 lines
963 B
Vue
<template>
|
|
<NuxtLayout class="select-none">
|
|
<NuxtPage />
|
|
</NuxtLayout>
|
|
{{ state }}
|
|
<input type="text" v-model="debugLocation" />
|
|
<NuxtLink :to="debugLocation">Go</NuxtLink>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { invoke } from "@tauri-apps/api/core";
|
|
// @ts-expect-error
|
|
import { AppStatus } from "./types.d.ts";
|
|
import { listen } from "@tauri-apps/api/event";
|
|
|
|
const router = useRouter();
|
|
|
|
const state: { status: AppStatus } = await invoke("fetch_state");
|
|
switch (state.status) {
|
|
case AppStatus.NotConfigured:
|
|
router.push("/setup");
|
|
break;
|
|
case AppStatus.SignedOut:
|
|
router.push("/auth");
|
|
break;
|
|
case AppStatus.SignedInNeedsReauth:
|
|
router.push("/auth/signedout");
|
|
break;
|
|
}
|
|
|
|
listen("auth/processing", () => {
|
|
router.push("/auth/processing");
|
|
});
|
|
|
|
listen("auth/failed", () => {
|
|
router.push("/auth/failed");
|
|
});
|
|
|
|
listen("auth/finished", () => {
|
|
router.push("/");
|
|
});
|
|
|
|
const debugLocation = ref("");
|
|
</script>
|