/* launch browser window */
await createWindow();
+ console.log('[Session]: Connection Alive: ', "loading");
+
try {
authState = await accountAuth() as AuthState;
} catch(e) {
--- /dev/null
+<template>
+ <div>
+ <div v-if="isAlive">Nominal</div>
+ <div v-else>Connecting</div>
+ </div>
+</template>
+
+
+<script lang="ts">
+
+import { defineComponent } from 'vue'
+import { isAlive } from "@/render/shared/connectionStatus";
+
+export default defineComponent({
+ name: "ConnectionStatus",
+
+ setup() {
+ return {
+ isAlive
+ }
+ }
+
+})
+
+</script>
+
class="menuButton minimizeButton"
@click.prevent="postNavBarMin"
/>
+ <connection-status />
</span>
</template>
import { defineComponent } from "vue";
import { postNavBar } from "@/render/ipc";
+ import ConnectionStatus from "./connectionStatus.vue";
+
export default defineComponent({
name: "Header",
+ components: { ConnectionStatus },
setup() {
const postNavBarExit = () => postNavBar('close');
const postNavBarMin = () => postNavBar('min');
const INIT_MESSAGES_CHANNEL = "init-messages";
const ADD_MESSAGE_CHANNEL = "add-message";
const UPDATE_MESSAGE_CHANNEL = "update-message";
+const CONNECTION_STATUS_CHANNEL = "set-connection-status";
export const setProfileListener = new IpcRendererListener({
channel: SET_PROFILE_CHANNEL,
});
export const connectionStatusListener = new IpcRendererListener({
- channel: UPDATE_MESSAGE_CHANNEL,
+ channel: CONNECTION_STATUS_CHANNEL,
listenerCallback: setConnectionStatus
});
import { ref } from "vue";
export const isAlive = ref(false);
+
export const loading = ref(true);
export const setConnectionStatus: IpcListenerCallback<boolean | null> = (payload) => {
+ console.log('received payload', payload)
if (payload) {
isAlive.value = payload;
} else {
}
-const onConnectionStatusCallback = (alive: boolean) => {
- console.log('[Session]: Connection Alive: ', alive);
- // ipcEmit('connection-state', alive);
+const onConnectionStatusCallback = (isAlive: boolean | Error) => {
+ console.log('[Session]: Connection Alive: ', isAlive);
+ ipcEmit('set-connection-status', isAlive);
}
const { connect, send, close } = useWebsockets(