Add pre-fetch data handling for resources, users, and comments

This commit is contained in:
2025-07-14 11:47:59 +08:00
parent 6188b88917
commit 0ef8e14587
6 changed files with 60 additions and 13 deletions

View File

@@ -54,6 +54,11 @@ export default function CommentPage() {
});
return;
}
const preFetchData = app.getPreFetchData();
if (preFetchData?.comment?.id === id) {
setComment(preFetchData.comment);
return;
}
network.getComment(id).then((res) => {
if (res.success) {
setComment(res.data!);