Hello. I am wondering if it is possible to modify the code in experience builder developer edition so the user is not prompted when the app runs to Accept or Ignore the Restore Experience State. Instead, I would like the application to by default automatically restore the previous state every time the app loads.
This is something that was able to be accomplished in Web AppBuilder so I am hoping I can do something similar with Experience Builder. Below is an example of how this was solved in Web AppBuilder for reference. Any guidance would be greatly appreciated.
Solved: Web AppBuilder 2.0 app state default on - Esri Community
import { AppStateManager } from 'jimu-core'
// wait 100ms for the framework reading local state from client browser.
setTimeout(() => {
AppStateManager.getInstance().restoreLocalState()
},100)
Thank you for your suggestion and response. Where in the code would I implement this?
A custom widget will do.
The widget is a transparent box only for running the code.
Put the setTimeout in a React.useEffect in the widget's root.