mirror of
https://codeberg.org/kirche-im-netz/Startodon-Hub.git
synced 2025-08-04 18:24:37 +02:00
Seite Neuladen, wenn auf Bestätigt geklickt wurde
This commit is contained in:
parent
0a0e6b8538
commit
a703414979
1 changed files with 7 additions and 8 deletions
|
@ -14,10 +14,9 @@ export function getUserConsent() {
|
|||
// Überprüft, ob bereits eine Zustimmung vorliegt
|
||||
export function checkConsent() {
|
||||
const consent = getUserConsent();
|
||||
return consent === true; // Liefert true nur, wenn explizit zugestimmt wurde
|
||||
return consent === true; // Nur true wird akzeptiert
|
||||
}
|
||||
|
||||
|
||||
// Zeigt das Consent-Banner an
|
||||
export function showConsentPopup(onAccept, onDecline) {
|
||||
const title = 'Datenschutzeinstellungen';
|
||||
|
@ -45,13 +44,13 @@ export function showConsentPopup(onAccept, onDecline) {
|
|||
|
||||
// Event-Listener für die Buttons
|
||||
popup.querySelector('#consent-accept').addEventListener('click', () => {
|
||||
closePopup(popup); // Popup korrekt schließen
|
||||
onAccept(); // Zustimmung speichern
|
||||
setUserConsent(true); // Zustimmung speichern
|
||||
closePopup(popup); // Popup schließen
|
||||
window.location.reload(); // **Seite neuladen**
|
||||
});
|
||||
|
||||
|
||||
popup.querySelector('#consent-decline').addEventListener('click', () => {
|
||||
closePopup(popup); // Popup korrekt schließen
|
||||
onDecline(); // Ablehnung speichern
|
||||
setUserConsent(false); // Ablehnung speichern
|
||||
closePopup(popup); // Popup schließen
|
||||
});
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue