mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 20:27:23 +00:00
Update document title based on resource state in resource details page
This commit is contained in:
@@ -72,8 +72,12 @@ export default function ResourcePage() {
|
||||
}, [id]);
|
||||
|
||||
useEffect(() => {
|
||||
document.title = t("Resource Details");
|
||||
}, [t]);
|
||||
if (location.state.resource) {
|
||||
document.title = location.state.resource.title;
|
||||
} else {
|
||||
document.title = t("Resource Details");
|
||||
}
|
||||
}, [location.state.resource, t]);
|
||||
|
||||
useEffect(() => {
|
||||
setResource(null);
|
||||
|
Reference in New Issue
Block a user