Skip to content
Merged
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
7 changes: 1 addition & 6 deletions src/main/store/setting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class SettingStore {
name: 'ui_tars.setting',
defaults: {
language: 'en',
vlmProvider: env.vlmProvider || VlmProvider.Huggingface,
vlmProvider: (env.vlmProvider as VlmProvider) || VlmProvider.Huggingface,
vlmBaseUrl: env.vlmBaseUrl || '',
vlmApiKey: env.vlmApiKey || '',
vlmModelName: env.vlmModelName || '',
Expand All @@ -24,27 +24,22 @@ export class SettingStore {
key: K,
value: LocalStore[K],
): void {
// @ts-ignore
SettingStore.instance.set(key, value);
}

public static setStore(state: LocalStore): void {
// @ts-ignore
SettingStore.instance.set(state);
}

public static get<K extends keyof LocalStore>(key: K): LocalStore[K] {
// @ts-ignore
return SettingStore.instance.get(key);
}

public static getStore(): LocalStore {
// @ts-ignore
return SettingStore.instance.store;
}

public static clear(): void {
// @ts-ignore
SettingStore.instance.clear();
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/store/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export type LocalStore = {
vlmBaseUrl: string;
vlmApiKey: string;
vlmModelName: string;
screenshotScale: number; // 0.1 ~ 1.0
screenshotScale?: number; // 0.1 ~ 1.0
reportStorageBaseUrl?: string;
utioBaseUrl?: string;
};
1 change: 1 addition & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"compilerOptions": {
"baseUrl": ".",
"moduleResolution": "bundler",
"paths": {
"@shared/*": ["./src/shared/*"],
"@main/*": ["./src/main/*"],
Expand Down