Mercurial > gemma
diff client/src/store/application.js @ 4867:5555b77b8c4e
report backenderror due to failing OL loaders
author | Thomas Junk <thomas.junk@intevation.de> |
---|---|
date | Tue, 17 Dec 2019 14:27:44 +0100 |
parents | 850968005e0a |
children | 8f421cd3c746 |
line wrap: on
line diff
--- a/client/src/store/application.js Fri Dec 13 12:39:08 2019 +0100 +++ b/client/src/store/application.js Tue Dec 17 14:27:44 2019 +0100 @@ -26,6 +26,7 @@ secondaryLogo: process.env.VUE_APP_SECONDARY_LOGO_URL, logoForPDF: process.env.VUE_APP_LOGO_FOR_PDF_URL, popup: null, + backendError: false, paneSetup: "DEFAULT", paneRotate: 1, showSidebar: false, @@ -139,9 +140,22 @@ }, config: (state, config) => { state.config = config; + }, + setBackendErrorFlag: state => { + state.backendError = true; + }, + removeBackendErrorFlag: state => { + state.backendError = false; } }, actions: { + reportBackendError({ commit }) { + const TWOMINUTES = 2 * 60 * 1000; + commit("setBackendErrorFlag"); + setTimeout(() => { + commit("removeBackendErrorFlag"); + }, TWOMINUTES); + }, loadConfig({ commit }) { return HTTP.get("/system/settings", { headers: { "X-Gemma-Auth": localStorage.getItem("token") }