diff --git a/app/background.js b/app/background.js index ea1cbd1..9e4f87a 100644 --- a/app/background.js +++ b/app/background.js @@ -160,6 +160,18 @@ async function createWindow() { setThumbarButtons(); } +//Single instance +const singleInstanceLock = app.requestSingleInstanceLock(); +if (!singleInstanceLock) { + app.quit(); +} else { + app.on('second-instance', () => { + if (win) { + if (!win.visible) win.show(); + } + }); +} + //Create window app.on('ready', async () => { await startServer(); diff --git a/app/client/src/App.vue b/app/client/src/App.vue index 178b292..cd2a321 100644 --- a/app/client/src/App.vue +++ b/app/client/src/App.vue @@ -130,7 +130,8 @@ - mdi-information + mdi-information + mdi-update {{$t('About')}} @@ -325,6 +326,7 @@ export default { cancelSuggestions: false, globalSnackbar: false, version: null, + updateAvailable: false } }, methods: { @@ -413,6 +415,15 @@ export default { maximize() { const {ipcRenderer} = window.require('electron'); ipcRenderer.send('maximize'); + }, + async checkUpdate() { + try { + let res = await this.$axios('/updates'); + if (res.data) + this.updateAvailable = true; + } catch (_) { + this.updateAvailable = false; + } } }, computed: { @@ -451,6 +462,9 @@ export default { //Wait for volume to load if (this.$root.loadingPromise) await this.$root.loadingPromise; this.volume = this.$root.volume; + + //Check for update + this.checkUpdate(); }, created() { //Go to login if unauthorized diff --git a/app/client/src/components/AlbumTile.vue b/app/client/src/components/AlbumTile.vue index 384d831..fd637b9 100644 --- a/app/client/src/components/AlbumTile.vue +++ b/app/client/src/components/AlbumTile.vue @@ -1,6 +1,6 @@