@immich/ui 0.42.1 → 0.42.2
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
2
|
import { commandPaletteManager, type CommandItem } from '../../services/command-palette-manager.svelte';
|
|
3
|
-
import {
|
|
3
|
+
import { untrack } from 'svelte';
|
|
4
4
|
|
|
5
5
|
type Props = {
|
|
6
6
|
commands?: CommandItem[];
|
|
@@ -9,5 +9,11 @@
|
|
|
9
9
|
|
|
10
10
|
const { commands = [], global }: Props = $props();
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
$effect(() => {
|
|
13
|
+
// prevent reactivity loop
|
|
14
|
+
const addCommands = (commands: CommandItem[], global?: boolean) =>
|
|
15
|
+
untrack(() => commandPaletteManager.addCommands(commands, { global }));
|
|
16
|
+
|
|
17
|
+
return addCommands(commands, global);
|
|
18
|
+
});
|
|
13
19
|
</script>
|
|
@@ -2,7 +2,7 @@ import { type Shortcut } from '../actions/shortcut.js';
|
|
|
2
2
|
import type { MaybeArray, TranslationProps } from '../types.js';
|
|
3
3
|
export type CommandItem = {
|
|
4
4
|
icon: string;
|
|
5
|
-
iconClass
|
|
5
|
+
iconClass?: string;
|
|
6
6
|
type: string;
|
|
7
7
|
title: string;
|
|
8
8
|
description?: string;
|