Browse Source

modifying argument of useModelNotification

WNomunomu 2 years ago
parent
commit
0ee00f03a8

+ 1 - 1
apps/app/src/components/InAppNotification/InAppNotificationElm.tsx

@@ -20,7 +20,7 @@ const InAppNotificationElm: FC<Props> = (props: Props) => {
 
   const { notification } = props;
 
-  const { Notification, publishOpen } = useModelNotification(notification, notification.targetModel);
+  const { Notification, publishOpen } = useModelNotification(notification);
 
   const clickHandler = async(notification: IInAppNotification & HasObjectId): Promise<void> => {
     if (notification.status === InAppNotificationStatuses.STATUS_UNOPENED) {

+ 3 - 1
apps/app/src/components/InAppNotification/PageNotification/index.tsx

@@ -16,7 +16,9 @@ type ModelNotificationUtils = {
   publishOpen: () => void
 }
 
-export const useModelNotification = (notification: IInAppNotification & HasObjectId, targetModel: string): ModelNotificationUtils => {
+export const useModelNotification = (notification: IInAppNotification & HasObjectId): ModelNotificationUtils => {
+
+  const targetModel = notification.targetModel;
 
   const router = useRouter();