This commit is contained in:
2020-07-23 19:13:38 +00:00
parent 8a713c2b1f
commit 1261116f1e
12 changed files with 81 additions and 64 deletions

View File

@@ -765,7 +765,9 @@ async function getUserOptions() {
languageOverride: null,
timeZoneOverride: null,
currencyName: null,
hour12: true
hour12: true,
uiColor: "#000000",
emailAddress: null
};
//get language to use, try user set override first, if empty then browser set, if empty then default to en-us
@@ -785,7 +787,10 @@ async function getUserOptions() {
l.hour12 = res.data.hour12;
}
window.$gz.store.commit("setLocale", l);
l.uiColor = res.data.uiColor || "#000000";
l.emailAddress = res.data.emailAddress || null;
window.$gz.store.commit("setUserOptions", l);
}
} catch (error) {
window.$gz.store.commit(

View File

@@ -32,13 +32,13 @@ export default {
// Get the user's chosen currency name
//https://en.wikipedia.org/wiki/ISO_4217
getCurrencyName() {
return window.$gz.store.state.locale.currencyName;
return window.$gz.store.state.userOptions.currencyName;
},
//////////////////////////////////////////////////
// Get the user's chosen 12hr clock
//
getHour12() {
return window.$gz.store.state.locale.hour12;
return window.$gz.store.state.userOptions.hour12;
},
///////////////////////////////////////////
// Turn a utc date into a displayable

View File

@@ -10,29 +10,27 @@ export default {
//expects extra data (tid) to be one of { type: [AYATYPE], id: [RECORDID] }
//or null which is what is called when asking to check if there is a direct openObject in store and open it
if (tid == null) {
let op = vm.$store.state.openObject;
//clear it out so it doesn't recur
window.$gz.store.commit("clearOpenObject");
if (op && op.type) {
tid = op;
} else {
//log it in case we need to see it in tech support
window.$gz.store.commit(
"logItem",
`Error: open object url was not valid, missing type or invalid type ${JSON.stringify(
op
)}`
);
return; //bail out, nothing to open here
}
}
// if (tid == null) {
// let op = vm.$store.state.openObject;
// //clear it out so it doesn't recur
// window.$gz.store.commit("clearOpenObject");
// if (op && op.type) {
// tid = op;
// } else {
// //log it in case we need to see it in tech support
// window.$gz.store.commit(
// "logItem",
// `Error: open object url was not valid, missing type or invalid type ${JSON.stringify(
// op
// )}`
// );
// return; //bail out, nothing to open here
// }
// }
//NOTE: for new objects all edit pages assume record ID 0 means create rather than open
if (tid.type && tid.id != null) {
console.log("tid", tid);
console.log("ayatype", ayatype);
switch (tid.type) {
case ayatype.Widget:
vm.$router.push({