Check for window.app

I don't have `window.app` anywhere in my frontend code, so I get an error at runtime. This patch adds a check