Skip to content

Commit

Permalink
gui: Show user action required notification on first check only
Browse files Browse the repository at this point in the history
So user doesn't get spammed with notifications.
  • Loading branch information
sebn committed Jul 17, 2018
1 parent 6724479 commit fca5a84
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gui/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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']
)
Expand Down

0 comments on commit fca5a84

Please sign in to comment.