Fix announcements not closing when button is pressed
This commit is contained in:
parent
87630c87a6
commit
61d77bf20e
|
@ -1,4 +1,5 @@
|
||||||
import { Controller } from '@hotwired/stimulus';
|
import { Controller } from '@hotwired/stimulus';
|
||||||
|
import { Alert } from 'bootstrap';
|
||||||
|
|
||||||
export default class extends Controller {
|
export default class extends Controller {
|
||||||
static values = {
|
static values = {
|
||||||
|
@ -15,5 +16,8 @@ export default class extends Controller {
|
||||||
|
|
||||||
close(): void {
|
close(): void {
|
||||||
window.localStorage.setItem(`announcement${this.idValue}`, 'true');
|
window.localStorage.setItem(`announcement${this.idValue}`, 'true');
|
||||||
|
|
||||||
|
const alert = Alert.getOrCreateInstance(this.element);
|
||||||
|
alert.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue