@cccsaurora/howler-ui 2.15.0-dev.313 → 2.15.0-dev.314
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -14,6 +14,7 @@ const useTitle = () => {
|
|
|
14
14
|
const sitemap = useMySitemap();
|
|
15
15
|
const { getAnalyticFromId } = useContext(AnalyticContext);
|
|
16
16
|
const hits = useContextSelector(HitContext, ctx => ctx.hits);
|
|
17
|
+
const getHit = useContextSelector(HitContext, ctx => ctx.getHit);
|
|
17
18
|
const setTitle = useCallback((title) => {
|
|
18
19
|
document.querySelector('title').innerHTML = title;
|
|
19
20
|
}, []);
|
|
@@ -34,7 +35,10 @@ const useTitle = () => {
|
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
else if (searchType === 'hit' && params.id) {
|
|
37
|
-
const hit = hits[params.id];
|
|
38
|
+
const hit = hits[params.id] ?? (await getHit(params.id));
|
|
39
|
+
if (!hit) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
38
42
|
let newTitle = `${capitalize(hit.howler.escalation)} - ${hit.howler.analytic}`;
|
|
39
43
|
if (hit.howler.detection) {
|
|
40
44
|
newTitle += `: ${hit.howler.detection}`;
|
|
@@ -60,7 +64,7 @@ const useTitle = () => {
|
|
|
60
64
|
setTitle(`Howler - ${t(matchingRoute.title)}`);
|
|
61
65
|
}
|
|
62
66
|
}
|
|
63
|
-
}, [
|
|
67
|
+
}, [location.pathname, params.id, searchParams, getAnalyticFromId, setTitle, t, hits, getHit, sitemap.routes]);
|
|
64
68
|
useEffect(() => {
|
|
65
69
|
runChecks();
|
|
66
70
|
}, [runChecks]);
|