This commit is contained in:
2019-05-28 23:15:31 +00:00
parent 1f7cd6b692
commit cddbf99177
3 changed files with 16 additions and 25 deletions

View File

@@ -1,4 +1,4 @@
/* eslint-disable */
/* xeslint-disable */
import store from "../store";
import roles from "./authorizationroles";
import locale from "./locale";
@@ -17,14 +17,8 @@ function addNavItem(title, icon, route) {
// Initialize the app
// on change of authentication status
export default function initialize() {
console.log("TOP:");
console.log(locale);
var promise = new Promise(function(resolve) {
console.log("2:");
console.log(locale);
if (store.state.authenticated) {
//Fetch the core localized text keys that will always be required by user
locale
.fetch(locale.coreKeys)
@@ -84,8 +78,6 @@ export default function initialize() {
// addNavItem(locale.get("Logout"), "sign-out-alt", "/login");
})
.then(() => {
console.log("3:");
console.log(locale);
//CACHE LOCALE SETTINGS
api
.get("UserOptions/" + store.state.userId)
@@ -101,10 +93,6 @@ export default function initialize() {
gzevent.$emit("notify-error", msg);
} else {
//TODO: also need the other locale settings such as number and date formats etc
console.log("4:");
console.log(locale);
var localOffset = new Date().getTimezoneOffset();
if (localOffset != 0) {
localOffset = (localOffset / 60) * -1; //time is in minutes and reversed from what we want or expect
@@ -125,12 +113,8 @@ export default function initialize() {
);
}
console.log("5:");
console.log(locale);
//Store offset in locale data
locale.timeZoneOffset = res.data.timeZoneOffset;
console.log("6 (after change):");
console.log(locale);
resolve();
}
})