This commit is contained in:
@@ -753,12 +753,12 @@ function initNavPanel() {
|
|||||||
addNavItem(t("Logout"), "fa-sign-out-alt", "/login", [], key++, "logout");
|
addNavItem(t("Logout"), "fa-sign-out-alt", "/login", [], key++, "logout");
|
||||||
}
|
}
|
||||||
|
|
||||||
function getUserOptions() {
|
async function getUserOptions() {
|
||||||
return (
|
let res = await window.$gz.api.get(
|
||||||
window.$gz.api
|
"user-option/" + window.$gz.store.state.userId
|
||||||
.get("user-option/" + window.$gz.store.state.userId)
|
);
|
||||||
// eslint-disable-next-line
|
// eslint-disable-next-line
|
||||||
.then((res) => {
|
try {
|
||||||
if (res.error) {
|
if (res.error) {
|
||||||
//In a form this would trigger a bunch of validation or error display code but for here and now:
|
//In a form this would trigger a bunch of validation or error display code but for here and now:
|
||||||
//convert error to human readable string for display and popup a notification to user
|
//convert error to human readable string for display and popup a notification to user
|
||||||
@@ -798,15 +798,13 @@ function getUserOptions() {
|
|||||||
|
|
||||||
window.$gz.store.commit("setLocale", l);
|
window.$gz.store.commit("setLocale", l);
|
||||||
}
|
}
|
||||||
})
|
} catch (error) {
|
||||||
.catch(function handleFetchUserOptionsError(error) {
|
|
||||||
window.$gz.store.commit(
|
window.$gz.store.commit(
|
||||||
"logItem",
|
"logItem",
|
||||||
"Initialize::() fetch useroptions -> error" + error
|
"Initialize::() fetch useroptions -> error" + error
|
||||||
);
|
);
|
||||||
throw error;
|
throw error;
|
||||||
})
|
}
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////
|
/////////////////////////////////////
|
||||||
|
|||||||
Reference in New Issue
Block a user