Skip to content

Commit e171f02

Browse files
committed
Add missing error handling in main.js (acceptConsent)
1 parent 4332e4a commit e171f02

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)