Skip to content

Commit

Permalink
Fix announcements not closing when button is pressed
Browse files Browse the repository at this point in the history
  • Loading branch information
pixeldesu committed Jan 13, 2023
1 parent 87630c8 commit 61d77bf
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Controller } from '@hotwired/stimulus';
import { Alert } from 'bootstrap';

export default class extends Controller {
static values = {
Expand All @@ -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();
}
}

0 comments on commit 61d77bf

Please sign in to comment.