Skip to content

Commit

Permalink
review suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
pan-kot committed Sep 10, 2024
1 parent dfacaa6 commit ee1ed84
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/internal/plugins/controllers/alert-flash-content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ export class AlertFlashContentController {
onContentRegistered = (listener: AlertFlashContentRegistrationListener) => {
const cleanup = listener(this.#provider);
this.#listeners.push(listener);
this.#cleanups.set(listener, cleanup ?? null);
if (cleanup) {
this.#cleanups.set(listener, cleanup);
}

return () => {
this.#cleanups.get(listener)?.();
Expand Down

0 comments on commit ee1ed84

Please sign in to comment.