Closed shehjadkhan-ansys closed 1 year ago
Not sure what is the best approach to handle these cases, in this case we can make one more call to webrole API and remove the dependency on localstorage, but in general how should we handle such dependency as we have lot of features on profile page which are permission dependent for example on profile page if the user is license administrator they see manage button while other users see View button only and so on.
I don't have all the context here. Generally, you could have a central function with initializes the data and stores a Promise on the global window
object (or just as a variable in the JS module). Other code can then await
or .then()
when the data is ready.
https://github.com/hlxsites/zemax/pull/191 Should fix above issue, in above PR I am have added event listeners on the localstorage element and thus we would be able to render code currently but still update the view when results are back
This PR https://github.com/hlxsites/zemax/pull/172 introduced a bug
To reproduce
Further context webroles.js line 30 localStorage.setItem('webroles', JSON.stringify(webroles)); these webroles are read in user-tickets.js Line 10 const webroles = JSON.parse(localStorage.getItem('webroles'));