Open regorxxx opened 1 year ago
JSP3 has this issue too but there isn't anything that can be done (other than clarifying in the docs).
Code inside the callback definitely runs because I tested writing an external text file which works.
The issue here is that that fb2k itself is writing the panel configuration to theme.fth (DUI) or foo_ui_columns.dll.cfg (CUI) before we get notified that it is shutting down. Any subsequent changes made by window.SetProperty are lost in the ether.
Component authors control what is written to layout files but not when.
Yep, found the same logging to a file. The properties are properly written to the panel within the callback (GetProperty gets the updated value) but not saved to the config file.
A warning should be added then to be cautious about what code is run there.
I've added a note to my own docs...
https://jscript-panel.github.io/docs/callbacks/#on_script_unload
on_script_unload() when foobar is closed (without errors) is behaving badly.
I have a code to save a property on script unload and it works fine on panel reload, but it doesn't work when closing foobar.
function on_script_unload(){ window.SetProperty(p[0],p[1]); }