mirror of
https://github.com/Drop-OSS/drop-app.git
synced 2025-11-09 20:12:14 +10:00
44 lines
907 B
Vue
44 lines
907 B
Vue
<template>
|
|
<NuxtLayout class="select-none w-screen h-screen">
|
|
<NuxtPage />
|
|
<ModalStack />
|
|
</NuxtLayout>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import "~/composables/downloads.js";
|
|
|
|
import { invoke } from "@tauri-apps/api/core";
|
|
import { AppStatus } from "~/types";
|
|
import { listen } from "@tauri-apps/api/event";
|
|
import { useAppState } from "./composables/app-state.js";
|
|
import {
|
|
initialNavigation,
|
|
setupHooks,
|
|
} from "./composables/state-navigation.js";
|
|
|
|
const router = useRouter();
|
|
|
|
const state = useAppState();
|
|
try {
|
|
state.value = JSON.parse(await invoke("fetch_state"));
|
|
} catch (e) {
|
|
console.error("failed to parse state", e);
|
|
}
|
|
|
|
router.beforeEach(async () => {
|
|
try {
|
|
state.value = JSON.parse(await invoke("fetch_state"));
|
|
} catch (e) {
|
|
console.error("failed to parse state", e);
|
|
}
|
|
});
|
|
|
|
setupHooks();
|
|
initialNavigation(state);
|
|
|
|
useHead({
|
|
title: "Drop",
|
|
});
|
|
</script>
|