修复消除未读消息数量问题

This commit is contained in:
al 2024-12-24 18:46:46 +08:00
parent dd2de79a3f
commit 339aab3baa
1 changed files with 10 additions and 1 deletions

View File

@ -8,7 +8,9 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faAngleLeft } from "@fortawesome/free-solid-svg-icons"; import { faAngleLeft } from "@fortawesome/free-solid-svg-icons";
import InfiniteScrollContent from "@/components/InfiniteScrollContent"; import InfiniteScrollContent from "@/components/InfiniteScrollContent";
import OwnIcon from "@/components/OwnIcon"; 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 searchParams = useSearchParams();
const [hasMore, setHasMore] = useState(1); const [hasMore, setHasMore] = useState(1);
const [offset, setOffset] = useState(0); const [offset, setOffset] = useState(0);
@ -39,6 +41,7 @@ export default function SystemNotice({ mid, total, ...props }) {
}); });
return; return;
} }
changeNoticeCount();
received.current = true; received.current = true;
} }
@ -142,3 +145,9 @@ export default function SystemNotice({ mid, total, ...props }) {
</div> </div>
); );
} }
const mapDispatchToProps = {
changeNoticeCount,
};
export default connect(null, mapDispatchToProps)(SystemNotice);