Undo button (#76)
This commit is contained in:
@@ -494,7 +494,6 @@ export function registerAppHandlers() {
|
||||
_,
|
||||
{ appId, previousVersionId }: { appId: number; previousVersionId: string }
|
||||
) => {
|
||||
logger.log(`Reverting to version ${previousVersionId} for app ${appId}`);
|
||||
return withLock(appId, async () => {
|
||||
const app = await db.query.apps.findFirst({
|
||||
where: eq(apps.id, appId),
|
||||
|
||||
@@ -787,25 +787,31 @@ export class IpcClient {
|
||||
|
||||
public async listLocalOllamaModels(): Promise<LocalModel[]> {
|
||||
try {
|
||||
const response = await this.ipcRenderer.invoke("local-models:list-ollama");
|
||||
const response = await this.ipcRenderer.invoke(
|
||||
"local-models:list-ollama"
|
||||
);
|
||||
return response?.models || [];
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
throw new Error(`Failed to fetch Ollama models: ${error.message}`);
|
||||
}
|
||||
throw new Error('Failed to fetch Ollama models: Unknown error occurred');
|
||||
throw new Error("Failed to fetch Ollama models: Unknown error occurred");
|
||||
}
|
||||
}
|
||||
|
||||
public async listLocalLMStudioModels(): Promise<LocalModel[]> {
|
||||
try {
|
||||
const response = await this.ipcRenderer.invoke("local-models:list-lmstudio");
|
||||
const response = await this.ipcRenderer.invoke(
|
||||
"local-models:list-lmstudio"
|
||||
);
|
||||
return response?.models || [];
|
||||
} catch (error) {
|
||||
if (error instanceof Error) {
|
||||
throw new Error(`Failed to fetch LM Studio models: ${error.message}`);
|
||||
}
|
||||
throw new Error('Failed to fetch LM Studio models: Unknown error occurred');
|
||||
throw new Error(
|
||||
"Failed to fetch LM Studio models: Unknown error occurred"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user