From fca5a841b2d78fb52cfae67f2f60923df4391291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Nicouleaud?= Date: Tue, 17 Jul 2018 12:34:28 +0200 Subject: [PATCH] gui: Show user action required notification on first check only So user doesn't get spammed with notifications. --- gui/main.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gui/main.js b/gui/main.js index 68f3ae35a..0618c8e68 100644 --- a/gui/main.js +++ b/gui/main.js @@ -22,6 +22,7 @@ const {buildAppMenu} = require('./js/appmenu') const i18n = require('./js/i18n') const {translate} = i18n const {incompatibilitiesErrorMessage} = require('./js/incompatibilitiesmsg') +const UserActionRequiredDialog = require('./js/components/UserActionRequiredDialog') const {app, Menu, Notification, ipcMain, dialog} = require('electron') // FIXME: https://github.com/electron/electron/issues/10864 @@ -264,6 +265,10 @@ const startSync = (force, ...args) => { .then(() => sendErrorToMainWindow('stopped')) .catch((err) => { if (err.status === 402) { + // Only show notification popup on the first check (the GUI will + // include a warning anyway). + if (!userActionRequired) UserActionRequiredDialog.show(err) + userActionRequired = pick(err, ['title', 'code', 'detail', 'links', 'message'] )