scripting: stateSet: add optional {send: false} flag

This commit is contained in:
jean-emmanuel 2023-11-22 10:15:40 +01:00
parent 2c97ac662c
commit a6237a0aac
3 changed files with 11 additions and 3 deletions

View file

@ -330,12 +330,12 @@ class ScriptVm extends Vm {
}
this.sandbox.contentWindow.stateSet = (state)=>{
this.sandbox.contentWindow.stateSet = (state, extraOptions = {})=>{
this.checkContext('stateSet')
var options = this.getValueOptions()
stateManager.set(state, options.send)
stateManager.set(state, extraOptions.send === false ? false : options.send)
}