HUGE REFACTOR / CLEANUP

if there is a issue it's probably something in here that was changed
This commit is contained in:
2021-09-28 20:19:44 +00:00
parent 51eddfede9
commit d0afdd9855
238 changed files with 3127 additions and 8614 deletions

View File

@@ -1,4 +1,3 @@
/* xeslint-disable */
let lastMessageHash = 0;
let lastMessageTimeStamp = new Date();
@@ -9,9 +8,9 @@ let lastMessageTimeStamp = new Date();
async function dealWithError(msg, vm) {
//Check if this is the same message again as last time within a short time span to avoid endless looping errors of same message
//but still allow for user to repeat operation that causes error so they can view it
let newHash = window.$gz.util.quickHash(msg);
const newHash = window.$gz.util.quickHash(msg);
if (newHash == lastMessageHash) {
let tsnow = new Date();
const tsnow = new Date();
//don't show the same exact message if it was just shown less than 1 second ago
if (tsnow - lastMessageTimeStamp < 1000) return;
}
@@ -29,7 +28,7 @@ async function dealWithError(msg, vm) {
}
window.$gz.store.commit("logItem", msg);
if (window.$gz.dev) {
let errMsg = "DEV MODE errorHandler.js:: Unexpected error: \r\n" + msg;
const errMsg = "DEV MODE errorHandler.js:: Unexpected error: \r\n" + msg;
// eslint-disable-next-line no-console
console.error(errMsg);
@@ -41,7 +40,6 @@ async function dealWithError(msg, vm) {
if (!vm || vm.formState == undefined) {
//popup if no place to display it elsewise
window.$gz.eventBus.$emit("notify-error", msg);
//debugger;
return;
}
@@ -98,7 +96,7 @@ function decodeError(e, vm) {
//API error object?
if (e.error) {
let err = e.error;
const err = e.error;
// {
// "code": "2002",
// "message": "See server log for details",