Fixed race condition.

This commit is contained in:
Martin Edenhofer 2016-09-11 10:47:44 +02:00
parent c28c8514c4
commit ef7a8a3277

View file

@ -37,13 +37,19 @@ class Index extends App.ControllerContent
setMode: (e) =>
value = @modeSetting.prop('checked')
callback = ->
App.Setting.set('maintenance_mode', value)
App.Setting.set(
'maintenance_mode',
value,
{
done: ->
App.WebSocket.send(
event:'maintenance'
data:
type: 'mode'
on: value
)
}
)
if value
new App.ControllerConfirm(
message: 'Sure?'