diff --git a/app/noticeDetail/systemNotice/[type]/page.js b/app/noticeDetail/systemNotice/[type]/page.js index 4fb884a..835ccf4 100644 --- a/app/noticeDetail/systemNotice/[type]/page.js +++ b/app/noticeDetail/systemNotice/[type]/page.js @@ -8,7 +8,9 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faAngleLeft } from "@fortawesome/free-solid-svg-icons"; import InfiniteScrollContent from "@/components/InfiniteScrollContent"; import OwnIcon from "@/components/OwnIcon"; -export default function SystemNotice({ mid, total, ...props }) { +import { changeNoticeCount } from "@/store/actions"; +import { connect } from "react-redux"; +function SystemNotice({ mid, changeNoticeCount, total, ...props }) { const searchParams = useSearchParams(); const [hasMore, setHasMore] = useState(1); const [offset, setOffset] = useState(0); @@ -39,6 +41,7 @@ export default function SystemNotice({ mid, total, ...props }) { }); return; } + changeNoticeCount(); received.current = true; } @@ -142,3 +145,9 @@ export default function SystemNotice({ mid, total, ...props }) { ); } + +const mapDispatchToProps = { + changeNoticeCount, +}; + +export default connect(null, mapDispatchToProps)(SystemNotice);