fix splash screen
This commit is contained in:
parent
854d6dd6a2
commit
c7f91d3e6b
8 changed files with 61 additions and 77 deletions
19
src/App.vue
19
src/App.vue
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<div id="app" v-if="!loading">
|
||||
<div id="app" v-if="ready">
|
||||
|
||||
<button class="titlebar">
|
||||
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import {defineComponent} from 'vue';
|
||||
import { defineComponent, onMounted, onUnmounted, ref } from 'vue';
|
||||
import { useIpc } from "@/modules/ipc";
|
||||
import { useAuth } from "@/modules/auth";
|
||||
import Splash from "@/components/splash.vue"
|
||||
|
|
@ -28,9 +28,18 @@ export default defineComponent({
|
|||
components: { Splash },
|
||||
|
||||
setup() {
|
||||
|
||||
const { invoke } = useIpc();
|
||||
const { loading } = useAuth();
|
||||
const ready = ref(false);
|
||||
|
||||
onMounted(() => {
|
||||
window.ipcRenderer.on('window-ready', (_event, payload: {message: boolean}) => {
|
||||
ready.value = payload.message;
|
||||
})
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
window.ipcRenderer.removeAllListeners('window-ready')
|
||||
})
|
||||
|
||||
const callNavbar = (action: string) => {
|
||||
invoke('nav-bar', action);
|
||||
|
|
@ -38,7 +47,7 @@ export default defineComponent({
|
|||
|
||||
return {
|
||||
callNavbar,
|
||||
loading
|
||||
ready
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Reference in a new issue