Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions apps/desktop/src/lib/codegen/messageQueue.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ export class MessageQueueProcessor {
$effect(() => {
for (const id of queueIds) {
const queue = $derived(messageQueueSelectors.selectById(this.clientState.messageQueue, id));
if (queue) {
$effect(() => {
$effect(() => {
if (queue) {
this.handleQueue(queue);
});
}
}
});
}
});
}
Expand Down
27 changes: 15 additions & 12 deletions apps/desktop/src/lib/state/uiState.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
type ThunkDispatch,
type UnknownAction
} from '@reduxjs/toolkit';
import { untrack } from 'svelte';
import type { ThinkingLevel, ModelType, PermissionMode } from '$lib/codegen/types';
import type { PullRequest } from '$lib/forge/interface/types';
import type { StackDetails } from '$lib/stacks/stack';
Expand Down Expand Up @@ -267,18 +268,20 @@ export class UiState {
};

// If the value is an array of strings, we add methods to add/remove
if (Array.isArray(mutableResult) && mutableResult.every(isStr)) {
(props[key] as GlobalProperty<string[]>).add = (...value: string[]) => {
const current = mutableResult as string[];
mutableResult = [...current, ...value.filter((v) => !current.includes(v))];
this.update(`${id}:${key}`, mutableResult);
};
(props[key] as GlobalProperty<string[]>).remove = (value: string) => {
const current = mutableResult as string[];
mutableResult = current.filter((v) => v !== value);
this.update(`${id}:${key}`, mutableResult);
};
}
untrack(() => {
if (Array.isArray(mutableResult) && mutableResult.every(isStr)) {
(props[key] as GlobalProperty<string[]>).add = (...value: string[]) => {
const current = mutableResult as string[];
mutableResult = [...current, ...value.filter((v) => !current.includes(v))];
this.update(`${id}:${key}`, mutableResult);
};
(props[key] as GlobalProperty<string[]>).remove = (value: string) => {
const current = mutableResult as string[];
mutableResult = current.filter((v) => v !== value);
this.update(`${id}:${key}`, mutableResult);
};
}
});
}
scopeCache[id] = props as GlobalStore<T>;
return scopeCache[id];
Expand Down
3 changes: 1 addition & 2 deletions apps/desktop/src/lib/worktree/worktreeService.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ export class WorktreeService {
}

worktreeData(projectId: string) {
const result = $derived(this.api.endpoints.worktreeChanges.useQuery({ projectId }));
return result;
return this.api.endpoints.worktreeChanges.useQuery({ projectId });
}

treeChangeByPath(projectId: string, path: string) {
Expand Down
Loading