Skip to content

Commit

Permalink
chore: fix notification
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Feb 2, 2025
1 parent 9a4df1d commit 865bb7c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions satellite/src/electronUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,11 @@ export class ElectronUpdater {
autoUpdater
.checkForUpdates()
.then((info) => {
// HACK: If there is a cancellation token, it found an update.
// This is not a good test, but the only other ways require comparing version numbers the same as electron-updater, or to listen to the emitted events instead
const hasUpdate = !!info?.cancellationToken
if (notifyWithDialog) {
// HACK: If there is a cancellation token, it found an update.
// This is not a good test, but the only other ways require comparing version numbers the same as electron-updater, or to listen to the emitted events instead
if (info?.cancellationToken) {
if (hasUpdate) {
dialog
.showMessageBox({
title: 'Companion Satellite',
Expand Down Expand Up @@ -95,7 +96,7 @@ export class ElectronUpdater {
}
} else {
// Show a system notification instead
if (info) {
if (hasUpdate) {
if (!this.#updateNotification) {
this.#updateNotification = new Notification({
title: 'An update is available',
Expand Down

0 comments on commit 865bb7c

Please sign in to comment.