fix splash screen

This commit is contained in:
riqo 2021-03-04 10:36:53 -06:00
commit c7f91d3e6b
8 changed files with 61 additions and 77 deletions

View file

@ -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
}
}
})