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) =>
|
setMode: (e) =>
|
||||||
value = @modeSetting.prop('checked')
|
value = @modeSetting.prop('checked')
|
||||||
callback = ->
|
callback = ->
|
||||||
App.Setting.set('maintenance_mode', value)
|
App.Setting.set(
|
||||||
|
'maintenance_mode',
|
||||||
|
value,
|
||||||
|
{
|
||||||
|
done: ->
|
||||||
App.WebSocket.send(
|
App.WebSocket.send(
|
||||||
event:'maintenance'
|
event:'maintenance'
|
||||||
data:
|
data:
|
||||||
type: 'mode'
|
type: 'mode'
|
||||||
on: value
|
on: value
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
)
|
||||||
if value
|
if value
|
||||||
new App.ControllerConfirm(
|
new App.ControllerConfirm(
|
||||||
message: 'Sure?'
|
message: 'Sure?'
|
||||||
|
|
Loading…
Reference in a new issue