fix infinite loop: use onMount instead of $effect for sidebar action
This commit is contained in:
parent
34821aa487
commit
b047552d7d
1 changed files with 2 additions and 1 deletions
|
|
@ -7,6 +7,7 @@
|
|||
* Shows artifact info in read-only mode. If user is owner,
|
||||
* provides Edit button in header to push edit pane onto stack.
|
||||
*/
|
||||
import { onMount } from 'svelte'
|
||||
import type { CollectionArtifact } from '$lib/types/api/artifact'
|
||||
import { isQuirkArtifact } from '$lib/types/api/artifact'
|
||||
import { usePaneStack, type PaneConfig } from '$lib/stores/paneStack.svelte'
|
||||
|
|
@ -64,7 +65,7 @@
|
|||
}
|
||||
|
||||
// Set up the Edit action button in the pane header for owners
|
||||
$effect(() => {
|
||||
onMount(() => {
|
||||
if (isOwner) {
|
||||
sidebar.setAction(handleEdit, 'Edit')
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue