Skip to content

Commit b581a3b

Browse files
committed
Avoid build warnings
1 parent 99043a3 commit b581a3b

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed

apps/desktop/src/lib/codegen/messageQueue.svelte.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,11 @@ export class MessageQueueProcessor {
121121
$effect(() => {
122122
for (const id of queueIds) {
123123
const queue = $derived(messageQueueSelectors.selectById(this.clientState.messageQueue, id));
124-
if (queue) {
125-
$effect(() => {
124+
$effect(() => {
125+
if (queue) {
126126
this.handleQueue(queue);
127-
});
128-
}
127+
}
128+
});
129129
}
130130
});
131131
}

apps/desktop/src/lib/state/uiState.svelte.ts

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
type ThunkDispatch,
1111
type UnknownAction
1212
} from '@reduxjs/toolkit';
13+
import { untrack } from 'svelte';
1314
import type { ThinkingLevel, ModelType, PermissionMode } from '$lib/codegen/types';
1415
import type { PullRequest } from '$lib/forge/interface/types';
1516
import type { StackDetails } from '$lib/stacks/stack';
@@ -267,18 +268,20 @@ export class UiState {
267268
};
268269

269270
// If the value is an array of strings, we add methods to add/remove
270-
if (Array.isArray(mutableResult) && mutableResult.every(isStr)) {
271-
(props[key] as GlobalProperty<string[]>).add = (...value: string[]) => {
272-
const current = mutableResult as string[];
273-
mutableResult = [...current, ...value.filter((v) => !current.includes(v))];
274-
this.update(`${id}:${key}`, mutableResult);
275-
};
276-
(props[key] as GlobalProperty<string[]>).remove = (value: string) => {
277-
const current = mutableResult as string[];
278-
mutableResult = current.filter((v) => v !== value);
279-
this.update(`${id}:${key}`, mutableResult);
280-
};
281-
}
271+
untrack(() => {
272+
if (Array.isArray(mutableResult) && mutableResult.every(isStr)) {
273+
(props[key] as GlobalProperty<string[]>).add = (...value: string[]) => {
274+
const current = mutableResult as string[];
275+
mutableResult = [...current, ...value.filter((v) => !current.includes(v))];
276+
this.update(`${id}:${key}`, mutableResult);
277+
};
278+
(props[key] as GlobalProperty<string[]>).remove = (value: string) => {
279+
const current = mutableResult as string[];
280+
mutableResult = current.filter((v) => v !== value);
281+
this.update(`${id}:${key}`, mutableResult);
282+
};
283+
}
284+
});
282285
}
283286
scopeCache[id] = props as GlobalStore<T>;
284287
return scopeCache[id];

apps/desktop/src/lib/worktree/worktreeService.svelte.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ export class WorktreeService {
4343
}
4444

4545
worktreeData(projectId: string) {
46-
const result = $derived(this.api.endpoints.worktreeChanges.useQuery({ projectId }));
47-
return result;
46+
return this.api.endpoints.worktreeChanges.useQuery({ projectId });
4847
}
4948

5049
treeChangeByPath(projectId: string, path: string) {

0 commit comments

Comments
 (0)