Fixed race condition.
This commit is contained in:
parent
c28c8514c4
commit
ef7a8a3277
1 changed files with 12 additions and 6 deletions
|
@ -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?'
|
||||
|
|
Loading…
Reference in a new issue