Skip to content

Commit

Permalink
format fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RiXelanya committed Jan 23, 2024
1 parent c2e98e3 commit b538825
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/components/Notifications/hooks/use-notification-list.hook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,13 @@ const parseTipAmountContainingENumber = (message: string) => {

const parseText = (message: string) => {
try {
const newMessage = JSON.parse(message);
const text = newMessage[0].children[0].text ;
return text ? text : ""
}
catch {
return ""
}
}
const newMessage = JSON.parse(message);
const text = newMessage[0].children[0].text;
return text ? text : '';
} catch {
return '';
}
};

export const useNotificationList = (
notifications: Notification[],
Expand Down Expand Up @@ -167,7 +166,9 @@ export const useNotificationList = (
userId: notification.fromUserId.id,
user: notification.fromUserId.name,
avatar: notification.fromUserId.profilePictureURL,
description: i18n.t('Notification.Description.Post_Comment') + parseText(notification.message),
description:
i18n.t('Notification.Description.Post_Comment') +
parseText(notification.message),
badge: (
<div className={style.circle}>
<SvgIcon
Expand Down

0 comments on commit b538825

Please sign in to comment.