notifications: replace some popup with notification
This commit is contained in:
parent
2c980ae1ad
commit
a2b387da4d
3 changed files with 20 additions and 5 deletions
|
|
@ -110,7 +110,6 @@ var SessionManager = class SessionManager {
|
|||
|
||||
ipc.send('log', 'Could not save session file')
|
||||
notifications.add({
|
||||
icon: 'exclamation',
|
||||
class: 'error',
|
||||
message: locales('session_saveerror')
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
var widgetManager = require('./widgets'),
|
||||
{icon, Popup, upload} = require('../ui/utils'),
|
||||
{upload} = require('../ui/utils'),
|
||||
notifications = require('../ui/notifications'),
|
||||
{saveAs} = require('file-saver'),
|
||||
locales = require('../locales')
|
||||
|
||||
|
|
@ -83,10 +84,25 @@ var StateManager = class StateManager {
|
|||
|
||||
load() {
|
||||
|
||||
function stateLoadError(){
|
||||
notifications.add({
|
||||
class: 'error',
|
||||
message: locales('state_uploaderror')
|
||||
})
|
||||
}
|
||||
|
||||
upload('.state', (path, result)=>{
|
||||
this.set(JSON.parse(result),true)
|
||||
try {
|
||||
this.set(JSON.parse(result),true)
|
||||
notifications.add({
|
||||
icon: 'sliders-h',
|
||||
message: locales('state_recallsuccess')
|
||||
})
|
||||
} catch(e) {
|
||||
stateLoadError()
|
||||
}
|
||||
}, (e)=>{
|
||||
new Popup({title:icon('exclamation-triangle')+' ' + locales('error'), content: locales('state_uploaderror'), closable:true})
|
||||
stateLoadError()
|
||||
})
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class Notifications {
|
|||
|
||||
var toast = html`
|
||||
<div class="toast ${data.class || ''}">
|
||||
<i class="fa fa-fw fa-${data.icon || 'bell'}"></i>
|
||||
<i class="fa fa-fw fa-${data.icon || (data.class === 'error' ? 'exclamation' : 'bell')}"></i>
|
||||
<div class="content">
|
||||
${data.message}
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue