web: fix notification badge not refreshing after clearing notifications

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer
2021-09-19 21:58:59 +02:00
parent 1670ec9167
commit 879b5ead71
3 changed files with 40 additions and 10 deletions

View File

@ -17,7 +17,7 @@ import PFDropdown from "@patternfly/patternfly/components/Dropdown/dropdown.css"
import PFButton from "@patternfly/patternfly/components/Button/button.css";
import AKGlobal from "../../authentik.css";
import PFContent from "@patternfly/patternfly/components/Content/content.css";
import { EVENT_NOTIFICATION_DRAWER_TOGGLE } from "../../constants";
import { EVENT_NOTIFICATION_DRAWER_TOGGLE, EVENT_REFRESH } from "../../constants";
import { ActionToLabel } from "../../pages/events/utils";
import { showMessage } from "../messages/MessageContainer";
import { MessageLevel } from "../messages/Message";
@ -114,6 +114,12 @@ export class NotificationDrawer extends LitElement {
})
.then(() => {
this.firstUpdated();
this.dispatchEvent(
new CustomEvent(EVENT_REFRESH, {
bubbles: true,
composed: true,
}),
);
});
}}
>
@ -174,6 +180,12 @@ export class NotificationDrawer extends LitElement {
message: t`Successfully cleared notifications`,
});
this.firstUpdated();
this.dispatchEvent(
new CustomEvent(EVENT_REFRESH, {
bubbles: true,
composed: true,
}),
);
});
}}
class="pf-c-button pf-m-secondary pf-m-block"