From 657cc6db28c735c30f668e5c1fb4aa3766a10913 Mon Sep 17 00:00:00 2001 From: TinCodes Date: Wed, 17 Jan 2024 16:14:48 -0400 Subject: [PATCH 1/2] Fixed console error --- resources/js/bootstrap.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/js/bootstrap.js b/resources/js/bootstrap.js index 261a852da8..17d5629940 100644 --- a/resources/js/bootstrap.js +++ b/resources/js/bootstrap.js @@ -297,7 +297,7 @@ if (window.Processmaker && window.Processmaker.broadcasting) { if (userID) { // Session timeout - const timeoutScript = document.head.querySelector("meta[name=\"timeout-worker\"]").content; + const timeoutScript = document.head.querySelector("meta[name=\"timeout-worker\"]")?.content; window.ProcessMaker.AccountTimeoutLength = parseInt(eval(document.head.querySelector("meta[name=\"timeout-length\"]").content)); window.ProcessMaker.AccountTimeoutWarnSeconds = parseInt(document.head.querySelector("meta[name=\"timeout-warn-seconds\"]").content); window.ProcessMaker.AccountTimeoutEnabled = document.head.querySelector("meta[name=\"timeout-enabled\"]") ? parseInt(document.head.querySelector("meta[name=\"timeout-enabled\"]").content) : 1; From 61cfc386c40c27ac45e6023fbba5fc9d45dc78bf Mon Sep 17 00:00:00 2001 From: TinCodes Date: Thu, 18 Jan 2024 15:02:37 -0400 Subject: [PATCH 2/2] Additional optional chainings made --- resources/js/bootstrap.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/resources/js/bootstrap.js b/resources/js/bootstrap.js index 17d5629940..45bca6ed9e 100644 --- a/resources/js/bootstrap.js +++ b/resources/js/bootstrap.js @@ -93,7 +93,7 @@ window.Vue.component("filter-table", FilterTable); let translationsLoaded = false; const mdates = JSON.parse( - document.head.querySelector("meta[name=\"i18n-mdate\"]").content, + document.head.querySelector("meta[name=\"i18n-mdate\"]")?.content, ); // Make $t available to all vue instances @@ -270,9 +270,9 @@ if (appUrl) { if (userID) { window.ProcessMaker.user = { id: userID.content, - datetime_format: formatDate.content, - calendar_format: formatDate.content, - timezone: timezone.content, + datetime_format: formatDate?.content, + calendar_format: formatDate?.content, + timezone: timezone?.content, fullName: userFullName?.content, avatar: userAvatar?.content, }; @@ -298,9 +298,9 @@ if (window.Processmaker && window.Processmaker.broadcasting) { if (userID) { // Session timeout const timeoutScript = document.head.querySelector("meta[name=\"timeout-worker\"]")?.content; - window.ProcessMaker.AccountTimeoutLength = parseInt(eval(document.head.querySelector("meta[name=\"timeout-length\"]").content)); - window.ProcessMaker.AccountTimeoutWarnSeconds = parseInt(document.head.querySelector("meta[name=\"timeout-warn-seconds\"]").content); - window.ProcessMaker.AccountTimeoutEnabled = document.head.querySelector("meta[name=\"timeout-enabled\"]") ? parseInt(document.head.querySelector("meta[name=\"timeout-enabled\"]").content) : 1; + window.ProcessMaker.AccountTimeoutLength = parseInt(eval(document.head.querySelector("meta[name=\"timeout-length\"]")?.content)); + window.ProcessMaker.AccountTimeoutWarnSeconds = parseInt(document.head.querySelector("meta[name=\"timeout-warn-seconds\"]")?.content); + window.ProcessMaker.AccountTimeoutEnabled = document.head.querySelector("meta[name=\"timeout-enabled\"]") ? parseInt(document.head.querySelector("meta[name=\"timeout-enabled\"]")?.content) : 1; window.ProcessMaker.AccountTimeoutWorker = new Worker(timeoutScript); window.ProcessMaker.AccountTimeoutWorker.addEventListener("message", (e) => { if (e.data.method === "countdown") {