StrokesPlus.net Forum
»
General Discussion
»
Scripts
»
Events firing when StrokesPlus is being reloaded
Rank: Member
Groups: Approved
Joined: 4/2/2020(UTC) Posts: 11 Thanks: 4 times Was thanked: 1 time(s) in 1 post(s)
|
So I think I have a bit of an edge case here. I have a Foreground Window Change script that calls a function defined in the Load script. When my computer resumes from sleep and I log in, I have strokesplus auto-reload itself. However, if I happen to click a different window or something when it's doing it's reload, the Foreground Window Change event fires and calls an undefined function because the reload hasn't completed.
It's not a huge deal since I can handle it like this, though I'm wondering if events should be disabled until SP has fully reloaded?
if (typeof(UpdateForegroundWindow) === "function") { UpdateForegroundWindow(false); }
|
|
|
|
Rank: Administration
Groups: Translators, Members, Administrators Joined: 1/11/2018(UTC) Posts: 1,349 Location: Tampa, FL Thanks: 28 times Was thanked: 416 time(s) in 354 post(s)
|
I'm tempted to leave it as it is, simply because someone may be using it in a way where they must always get the event - and some code wouldn't care if the reload is complete (like a static plug-in, stored value, etc.).
Yeah, your check works or just wrapping it in a try/catch.
|
|
|
|
StrokesPlus.net Forum
»
General Discussion
»
Scripts
»
Events firing when StrokesPlus is being reloaded
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The StrokesPlus.net Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close