Skip to content

Commit e96a949

Browse files
fix: switching projects via project dropdown
1 parent 78fac21 commit e96a949

File tree

1 file changed

+10
-6
lines changed
  • src/routes/(console)/project-[region]-[project]/(studio)/studio

1 file changed

+10
-6
lines changed

src/routes/(console)/project-[region]-[project]/(studio)/studio/+page.svelte

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script lang="ts">
2-
import { onDestroy, onMount, tick } from 'svelte';
2+
import { onDestroy, tick } from 'svelte';
33
import {
44
attachStudioTo,
55
ensureStudioComponent,
@@ -18,16 +18,20 @@
1818
attachStudioTo(anchor, { offsetX: 0, offsetY: 0 });
1919
}
2020
21-
onMount(async () => {
21+
async function setStudioParams(props: { projectId: string; region: string }) {
2222
ensureStudioComponent();
2323
await tick();
2424
positionStudio();
2525
navigateToRoute({
2626
id: 'project',
27-
props: {
28-
projectId: params.project,
29-
region: params.region
30-
}
27+
props
28+
});
29+
}
30+
31+
$effect(() => {
32+
setStudioParams({
33+
projectId: params.project,
34+
region: params.region
3135
});
3236
});
3337

0 commit comments

Comments
 (0)