This commit is contained in:
@@ -486,25 +486,36 @@ export default function InvestmentPath(path: Path) {
|
||||
window.location.hash,
|
||||
stageCodes.split(','),
|
||||
);
|
||||
if (
|
||||
path.preparation_action &&
|
||||
window.location.hash === '#tarefas'
|
||||
) {
|
||||
const target =
|
||||
root.current.ownerDocument.getElementById('tarefas');
|
||||
if (
|
||||
target?.tagName === 'DETAILS' &&
|
||||
root.current.contains(target)
|
||||
) {
|
||||
(target as HTMLDetailsElement).open = true;
|
||||
target.scrollIntoView({ block: 'start' });
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
reveal();
|
||||
window.addEventListener('hashchange', reveal);
|
||||
return () => window.removeEventListener('hashchange', reveal);
|
||||
}, [path.case.id, path.context_opportunity, stageCodes, path.next?.code]);
|
||||
}, [
|
||||
path.case.id,
|
||||
path.context_opportunity,
|
||||
stageCodes,
|
||||
path.next?.code,
|
||||
path.preparation_action?.id,
|
||||
]);
|
||||
const { auth, flash } = usePage<{
|
||||
auth: { user: { id: number } };
|
||||
flash: { success?: string };
|
||||
}>().props;
|
||||
useEffect(() => {
|
||||
if (path.preparation_action && window.location.hash === '#tarefas') {
|
||||
const target = document.getElementById('tarefas');
|
||||
if (target instanceof HTMLDetailsElement) {
|
||||
target.open = true;
|
||||
target.scrollIntoView({ block: 'start' });
|
||||
}
|
||||
}
|
||||
}, [path.preparation_action]);
|
||||
const facts = useForm({
|
||||
version: path.case.version,
|
||||
context_opportunity: path.context_opportunity,
|
||||
|
||||
Reference in New Issue
Block a user