From b3ffa1030d311283323556e7595b64b4046c46d1 Mon Sep 17 00:00:00 2001 From: Emili Castells Guasch Date: Wed, 29 May 2024 15:21:21 +0200 Subject: [PATCH] Fix stringify objects --- modules/ppcp-axo/resources/js/AxoManager.js | 4 ++-- modules/ppcp-axo/resources/js/Helper/Debug.js | 4 ++-- yarn.lock | 5 +++++ 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/ppcp-axo/resources/js/AxoManager.js b/modules/ppcp-axo/resources/js/AxoManager.js index b93703ace..960da7f26 100644 --- a/modules/ppcp-axo/resources/js/AxoManager.js +++ b/modules/ppcp-axo/resources/js/AxoManager.js @@ -212,7 +212,7 @@ class AxoManager { this.status.hasProfile ); - log(`Scenario: ${scenario}`); + log(`Scenario: ${JSON.stringify(scenario)}`); // Reset some elements to a default status. this.el.watermarkContainer.hide(); @@ -374,7 +374,7 @@ class AxoManager { setStatus(key, value) { this.status[key] = value; - log(`Status updated: ${JSON.parse(JSON.stringify(this.status))}`); + log(`Status updated: ${JSON.stringify(this.status)}`); document.dispatchEvent(new CustomEvent("axo_status_updated", {detail: this.status})); diff --git a/modules/ppcp-axo/resources/js/Helper/Debug.js b/modules/ppcp-axo/resources/js/Helper/Debug.js index 8073c2683..c08fa8087 100644 --- a/modules/ppcp-axo/resources/js/Helper/Debug.js +++ b/modules/ppcp-axo/resources/js/Helper/Debug.js @@ -1,5 +1,5 @@ export function log(message, level = 'info') { - const endpoint = this.axoConfig?.ajax?.frontend_logger?.endpoint; + const endpoint = window.wc_ppcp_axo?.ajax?.frontend_logger?.endpoint; if(!endpoint) { return; } @@ -8,7 +8,7 @@ export function log(message, level = 'info') { method: 'POST', credentials: 'same-origin', body: JSON.stringify({ - nonce: this.axoConfig.ajax.frontend_logger.nonce, + nonce: window.wc_ppcp_axo.ajax.frontend_logger.nonce, log: { message, level, diff --git a/yarn.lock b/yarn.lock index 722df19c5..81af54726 100644 --- a/yarn.lock +++ b/yarn.lock @@ -598,6 +598,11 @@ unbox-primitive@^1.0.2: has-symbols "^1.0.3" which-boxed-primitive "^1.0.2" +uuid@^9.0.1: + version "9.0.1" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-9.0.1.tgz#e188d4c8853cc722220392c424cd637f32293f30" + integrity sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA== + validate-npm-package-license@^3.0.1: version "3.0.4" resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz#fc91f6b9c7ba15c857f4cb2c5defeec39d4f410a"