Skip to content

Commit

Permalink
Merge pull request #196 from WoltLab/event-update-user-menu-item
Browse files Browse the repository at this point in the history
Event to update the counter in user menu
  • Loading branch information
Cyperghost authored Mar 8, 2024
2 parents ee5a6d0 + 3a2e468 commit 1e49678
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 37 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

72 changes: 36 additions & 36 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
"typescript": "^5.2.2"
},
"dependencies": {
"@woltlab/d.ts": "https://github.com/WoltLab/d.ts.git#c08648e9f82c381bd18b91ac1072c430e58e71f1"
"@woltlab/d.ts": "https://github.com/WoltLab/d.ts.git#4e9d0e4825110d3fd140cbdcecac6f1bcd7a1840"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import { dboAction } from "WoltLabSuite/Core/Ajax";
import UserMenuView from "WoltLabSuite/Core/Ui/User/Menu/View";
import {
EventUpdateCounter,
UserMenuButton,
UserMenuData,
UserMenuFooter,
Expand Down Expand Up @@ -55,6 +56,11 @@ class UserMenuDataConversation implements UserMenuProvider {
this.counter = counter;
}
}
this.button.addEventListener("updateCounter", (event: CustomEvent<EventUpdateCounter>) => {
this.updateCounter(event.detail.counter);

this.stale = true;
});
}

getPanelButton(): HTMLElement {
Expand Down

0 comments on commit 1e49678

Please sign in to comment.