Skip to content

Commit dcaba04

Browse files
authored
Merge pull request #184 from nemanjaASE/issue-174-missing-error-handling
Add missing error handling in main.js (acceptConsent)
2 parents f4271ef + e171f02 commit dcaba04

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

agentic_security/static/main.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,12 @@ var app = new Vue({
130130
},
131131
acceptConsent() {
132132
this.showConsentModal = false; // Close the modal
133-
localStorage.setItem('consentGiven', 'true'); // Save consent to local storage
133+
134+
try {
135+
localStorage.setItem('consentGiven', 'true'); // Save consent to local storage
136+
} catch (e) {
137+
this.showToast('Failed to save consent', 'error'); // Show error if saving fails
138+
}
134139
},
135140

136141
saveStateToLocalStorage() {

0 commit comments

Comments
 (0)