Add missing error handling in main.js (acceptConsent)

This commit is contained in:
nemanjaASE
2025-03-13 17:17:48 +01:00
parent 4332e4affd
commit e171f0216e
+6 -1
View File
@@ -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() {