scripting: soft and hard reload

This commit is contained in:
jean-emmanuel 2022-11-07 13:07:02 +01:00
parent a77a9c01dd
commit a90211223f
2 changed files with 6 additions and 4 deletions

View file

@ -530,7 +530,7 @@ class ScriptVm extends Vm {
}
this.sandbox.contentWindow.reload = ()=>{
this.sandbox.contentWindow.reload = (keepState = true)=>{
this.checkContext('reload')
@ -540,7 +540,8 @@ class ScriptVm extends Vm {
var widget = this.getWidget()
widget.errorProp('onCreate', '', 'reload() cannot be called from onCreate')
} else if (options.send){
ipc.trigger('reload')
if (keepState) ipd.trigger('reload')
else window.location.href = window.location.href
}