How can I clear the entire 'app' on form load?

Dan Rosenstein:
How can I clear the entire ‘app’ on form load? Tried ‘window.localStorage.clear();’ in a function action ‘onFormLoad’ but I guess that only clears the local storage. Tried ‘app={}’ - didn’t work either


Christina Saran:
Clearing the app model? Does it get populated later?


Dan Rosenstein:
say it’s populated and I log out - it’s still there


Christina Saran:
where are you adding the app={} is it on the login page?


Dan Rosenstein:
onformload


Christina Saran:
what page?


Christina Saran:
login?


Dan Rosenstein:
login


Dan Rosenstein:
tried on another page but didnt work either


Christina Saran:
ok, i have a bit of a trick that will work.

    "clearApp": [{
            "action": "function",
            "function": "setTimeout(() => {\n    vueapp.$[store.state.site.content.app](http://store.state.site.content.app) = {}\n    console.log(\"@clear\", app)\n}, \"0\");\n\n",
            "options": {}
        }],
        "onFormLoad": [{
            "action": "namedAction",
            "name": "clearApp"
        }]

Dan Rosenstein:
Cool. Will give it a try! thanks Christina :+1:


Christina Saran:
hope it helps Dan!


Dan Rosenstein:
Looks promising :sunglasses:


Dan Rosenstein:
Think it’s good. Maybe archive to forum. I think this could be helpful to others