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,12 +37,18 @@ class Index extends App.ControllerContent
setMode: (e) => setMode: (e) =>
value = @modeSetting.prop('checked') value = @modeSetting.prop('checked')
callback = -> callback = ->
App.Setting.set('maintenance_mode', value) App.Setting.set(
App.WebSocket.send( 'maintenance_mode',
event:'maintenance' value,
data: {
type: 'mode' done: ->
on: value App.WebSocket.send(
event:'maintenance'
data:
type: 'mode'
on: value
)
}
) )
if value if value
new App.ControllerConfirm( new App.ControllerConfirm(