Commit 2c975b1c authored by Connor Davis's avatar Connor Davis Committed by Tim Neutkens

Catch errors when loading a page in case a script 404s (#6729)

* Catch errors when loading page

* return promise instead of await
parent 18af71c0
......@@ -156,11 +156,11 @@ export default class PageLoader {
}
if (document.readyState === 'complete') {
await this.loadPage(route)
return this.loadPage(route).catch((e) => {})
} else {
return new Promise((resolve, reject) => {
window.addEventListener('load', () => {
this.loadPage(route).then(() => resolve(), reject)
this.loadPage(route).then(() => resolve(), () => resolve())
})
})
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment