1 parent d023b3d commit dcea89aCopy full SHA for dcea89a
1 file changed
src/components/Consent/Preferences/client/index.ts
@@ -262,10 +262,15 @@ export class ConsentPreferencesElement extends LitElement {
262
}
263
264
private showNotification(message: string): void {
265
+ document
266
+ .querySelectorAll<HTMLDivElement>('[data-testid="consent-toast"]')
267
+ .forEach((existingToast) => existingToast.remove())
268
+
269
// Create a simple notification
270
const notification = document.createElement('div')
271
notification.className =
272
'fixed top-4 right-4 bg-green-600 text-white px-6 py-3 rounded-lg shadow-lg z-50 transition-all duration-300'
273
+ notification.dataset['testid'] = 'consent-toast'
274
notification.textContent = message
275
276
document.body.appendChild(notification)
0 commit comments