Skip to content

Commit f382eb5

Browse files
committed
fix: update badge subscription logic to handle undefined values
1 parent f0a9c4d commit f382eb5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

adminforth/spa/src/stores/core.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ export const useCoreStore = defineStore('core', () => {
8686
}
8787
async function subscribeToMenuBadges() {
8888
const processItem = (mi: AdminForthConfigMenuItem) => {
89-
if (mi.badge) {
89+
90+
// console.log('🔔 subscribeToMenuBadges', mi.badge, JSON.stringify(mi));
91+
if (mi.badge !== undefined) {
9092
websocket.subscribe(`/opentopic/update-menu-badge/${mi.itemId}`, ({ badge }) => {
9193
mi.badge = badge;
9294
});

0 commit comments

Comments
 (0)