Kaynağa Gözat

Corrected processing of dialog return

David Benson 8 yıl önce
ebeveyn
işleme
bf371e2575
1 değiştirilmiş dosya ile 7 ekleme ve 6 silme
  1. 7 6
      war/electron.js

+ 7 - 6
war/electron.js

@@ -173,19 +173,20 @@ autoUpdater.on('update-available', (a, b) =>
 {
 	log.info('@update-available@\n', a, b)
 	
-	let idx = dialog.showMessageBox(
+	dialog.showMessageBox(
 	{
 		type: 'question',
 		buttons: ['Ok', 'Cancel'],
 		title: 'Confirm Update',
 		message: 'Update available.\n\nWould you like to download and install new version?',
 		detail: 'Application will automatically restart to apply update after download',
-	})
-	
-	if (idx === 0)
+	}, response =>
 	{
-		return autoUpdater.downloadUpdate()
-	}
+		if (response === 0)
+		{
+			return autoUpdater.downloadUpdate()
+		}
+	})
 })