Fix announcements not closing when button is pressed

This commit is contained in:
Andreas Nedbal 2023-01-13 18:37:03 +01:00 committed by Andreas Nedbal
parent 87630c87a6
commit 61d77bf20e
1 changed files with 4 additions and 0 deletions

View File

@ -1,4 +1,5 @@
import { Controller } from '@hotwired/stimulus';
import { Alert } from 'bootstrap';
export default class extends Controller {
static values = {
@ -15,5 +16,8 @@ export default class extends Controller {
close(): void {
window.localStorage.setItem(`announcement${this.idValue}`, 'true');
const alert = Alert.getOrCreateInstance(this.element);
alert.close();
}
}