Compare commits

...
Sign in to create a new pull request.
Author SHA1 Message Date
Enrique Hernandez
146677d1c7 add version to settings component 2021-05-21 08:42:49 -05:00
2 changed files with 13 additions and 3 deletions

View file

@ -1,7 +1,7 @@
"use strict";
import { app, dialog } from "electron";
import { app, dialog, ipcMain } from "electron";
import { createWindow } from './window';
import { initSession } from './session';
import { initAudioIO, stopStream } from './audio';
@ -42,6 +42,11 @@ autoUpdater.on('update-downloaded', (info: any) => {
async function main() {
console.log("MAIN:Initializing Electron App.")
ipcMain.removeHandler('version');
ipcMain.handle('version', (_event: any, _payload: any) => {
return app.getVersion();
})
// Must wait til window is created.
await createWindow();

View file

@ -27,7 +27,7 @@
<script lang="ts">
import { defineComponent, ref } from "vue";
import { defineComponent, ref, onMounted } from "vue";
import { useIpc } from "@/modules/ipc";
import { logoutRequest } from '@/modules/message';
@ -37,7 +37,7 @@
setup() {
const toggleSettings = ref(false);
const { post } = useIpc();
const { post, invoke } = useIpc();
// Listen for escape key to close settings.
const onEscape = (e: any) => {
@ -59,6 +59,11 @@
post("client-message", logoutRequest())
}
onMounted(async () => {
const version = await invoke('version', true);
console.log(version);
})
return {
onActive,
toggleSettings,