mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-06 05:42:37 +02:00
Remove sticky menu in simulation page
This commit is contained in:
parent
1174182980
commit
61d43149fa
1 changed files with 8 additions and 0 deletions
|
|
@ -62,6 +62,14 @@ export default function SimulationApp() {
|
||||||
getScenarios(projectId as string).then(setScenarios);
|
getScenarios(projectId as string).then(setScenarios);
|
||||||
}, [projectId]);
|
}, [projectId]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (menuOpenScenarioId) {
|
||||||
|
const closeMenu = () => setMenuOpenScenarioId(null);
|
||||||
|
window.addEventListener('click', closeMenu);
|
||||||
|
return () => window.removeEventListener('click', closeMenu);
|
||||||
|
}
|
||||||
|
}, [menuOpenScenarioId]);
|
||||||
|
|
||||||
const createNewScenario = async () => {
|
const createNewScenario = async () => {
|
||||||
if (!projectId) return;
|
if (!projectId) return;
|
||||||
const newScenarioId = await createScenario(
|
const newScenarioId = await createScenario(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue