mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-29 04:47:24 +00:00
Add pre-fetch data handling for resources, users, and comments
This commit is contained in:
@@ -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!);
|
||||
|
Reference in New Issue
Block a user