You're not understanding how Alpha works with localStorage and Persisting Variables.
Alpha Persists Variables using a specfic key made up of the word "ALPHA" and the component GUID and the word "._VARIABLES".
You shouldn't need to go to localStorage because the method .onRestoreVariablesFromLocalStorage() is supposed to have that data in a variable named e.userData.
However, in typical Alpha fashion... this is a bug... because the data isn't there.
Instead, the data is in a variable named e.data... but is compounded by another bug (I'm starting to shake my head again). Not all the data is there.
So, because Alpha is so flakey, you're back to getting the data from localStorage. There's one more problem, though. Alpha uses the componet GUID as part of the localStorage Key. But, Alpha changes the Guid... they remove the dashes from the GUID.
While in the method .onRestoreVariablesFromLocalStorage(), you can get most of the localStorage Key from this._localStorageSettings.namespace. Then add the word "._VARIABLES" and you can now get the data. Overall, it's a standard Alpha mess... but, as usual, you can work around their bugs and poor programming to get what you need.
This code builds the localStorage Key and then gets the string data... and parses it into JSON.
Code:
var lsKey = this._localStorageSettings.namespace + '._VARIABLES';
var lsData = JSON.parse(localStorage.getItem(lsKey));
If you wanted to get the Persisted Variables outside of .onRestoreVariablesFromLocalStorage() you can use {dialog.Object}.
Code:
var lsKey = {dialog.Object}._localStorageSettings.namespace + '._VARIABLES';
var lsData = JSON.parse(localStorage.getItem(lsKey));
Bookmarks