Skip to content

Commit

Permalink
add additional error logging to update
Browse files Browse the repository at this point in the history
  • Loading branch information
jazzyclimber committed Sep 19, 2022
1 parent 896c467 commit fb59c70
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "copilot",
"version": "0.1.18",
"version": "0.1.19",
"private": false,
"repository": "https://github.com/jazzyclimber/hs-desktop-app",
"description": "Assist HubSpot developers in module creation while developing on local machines",
Expand Down
2 changes: 1 addition & 1 deletion public/preload.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ contextBridge.exposeInMainWorld(
"ipc", {
send: (channel, data) => {
// whitelist channels
const validChannels = ["openDialog", "readFile", "saveFile", "helperTask", "updateGlobalDependants", "openSaveDialog"];
const validChannels = ["openDialog", "readFile", "saveFile", "helperTask", "updateGlobalDependants", "openSaveDialog", "quitAndUpdate"];
if (validChannels.includes(channel)) {
ipcRenderer.send(channel, data);
}
Expand Down
5 changes: 5 additions & 0 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,11 @@ autoUpdater.on('update-downloaded', (info) => {
})
})

ipcMain.on("quitAndUpdate", (event, args) => {
console.log('quitting now');
autoUpdater.quitAndInstall();
})


HelperTask

Expand Down
8 changes: 7 additions & 1 deletion src/components/notification.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<transition name="slide-in">
<article v-if="isVisible" class="fixed top-2 right-2 p-3 flex flex-row items-center justify-start gap-3 bg-gradient-to-r from-amber-500 to-orange-600 z-50 max-w-xs leading-tight" >
<img @click="isVisible = !isVisible" class="cursor-pointer" src="@/assets/close-white.svg" alt="close button" width="20">
<span class="text-white font-sans text-xs m-0">{{msg}}</span>
<span class="text-white font-sans text-xs m-0 block">{{msg}}</span>
<button class="border border-white py-1 px-5 text-xs text-white" @click="triggerInstall">Quit &amp; install</button>
</article>
</transition>
</template>
Expand All @@ -17,6 +18,11 @@ export default {
type: null
}
},
methods: {
triggerInstall: function() {
window.ipc.send('quitAndUpdate', "");
}
},
mounted () {
window.ipc.receive("notification", (payload) => {
console.log(payload);
Expand Down

0 comments on commit fb59c70

Please sign in to comment.