Skip to content

Commit

Permalink
Added comment explaining extra tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Harmit Goswami authored and Harmit Goswami committed Jan 15, 2025
1 parent b1a6116 commit ee41550
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions translate/src/hooks/useNotifications.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ export function useNotifications() {
useEffect(() => {
const rootElt = document.getElementById('root');
if (rootElt?.dataset.notifications) {
console.log(rootElt?.dataset.notifications);
const notifications = JSON.parse(rootElt.dataset.notifications);
if (notifications.length > 0) {
// Extra tags from the Django messages framework are combined
// with the level tag into a single string as notification.type
const generalNotification = notifications.find(
(notification: { type: string }) =>
notification.type !== 'badge info',
Expand Down

0 comments on commit ee41550

Please sign in to comment.