Skip to content

Commit

Permalink
Fixed dismissed updates hiding them entirely
Browse files Browse the repository at this point in the history
  • Loading branch information
xanderfrangos committed Apr 20, 2020
1 parent 69f122a commit 112db00
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -1395,9 +1395,11 @@ function createSettings() {

let latestVersion = false
let lastCheck = false
checkForUpdates = async () => {
if (!settings.checkForUpdates) return false;
if (lastCheck && lastCheck == new Date().getDate()) return false;
checkForUpdates = async (force = false) => {
if(!force) {
if (!settings.checkForUpdates) return false;
if (lastCheck && lastCheck == new Date().getDate()) return false;
}
lastCheck = new Date().getDate()
try {
const fetch = require('node-fetch');
Expand All @@ -1423,8 +1425,8 @@ checkForUpdates = async () => {
}
}

if (foundVersion && "v" + app.getVersion() != latestVersion.version && settings.dismissedUpdate != latestVersion.version) {
latestVersion.show = true
if (foundVersion && "v" + app.getVersion() != latestVersion.version && (settings.dismissedUpdate != latestVersion.version || force)) {
if(!force) latestVersion.show = true
console.log("Sending new version to windows.")
sendToAllWindows('latest-version', latestVersion)
}
Expand Down Expand Up @@ -1513,7 +1515,7 @@ function runUpdate(expectedSize = false) {
ipcMain.on('check-for-updates', () => {
latestVersion.error = false
sendToAllWindows('latest-version', latestVersion)
checkForUpdates()
checkForUpdates(true)
})

ipcMain.on('ignore-update', (event, dismissedUpdate) => {
Expand Down

0 comments on commit 112db00

Please sign in to comment.