From e171f0216e3a8cf535c8608134fe476675f069ce Mon Sep 17 00:00:00 2001 From: nemanjaASE <93867316+nemanjaASE@users.noreply.github.com> Date: Thu, 13 Mar 2025 17:17:48 +0100 Subject: [PATCH] Add missing error handling in main.js (acceptConsent) --- agentic_security/static/main.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/agentic_security/static/main.js b/agentic_security/static/main.js index 60fc6c3..c1bc281 100644 --- a/agentic_security/static/main.js +++ b/agentic_security/static/main.js @@ -130,7 +130,12 @@ var app = new Vue({ }, acceptConsent() { this.showConsentModal = false; // Close the modal - localStorage.setItem('consentGiven', 'true'); // Save consent to local storage + + try { + localStorage.setItem('consentGiven', 'true'); // Save consent to local storage + } catch (e) { + this.showToast('Failed to save consent', 'error'); // Show error if saving fails + } }, saveStateToLocalStorage() {