Skip to content

Commit

Permalink
refactor: adjust types
Browse files Browse the repository at this point in the history
  • Loading branch information
pixelass committed May 1, 2024
1 parent 5d01fe8 commit 4afb7d4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
15 changes: 10 additions & 5 deletions src/electron/helpers/ipc/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
import type { VectorStoreDocument } from "@captn/utils/types";
import { BrowserWindow, dialog, ipcMain } from "electron";
import { download } from "electron-dl";
import type ElectronStore from "electron-store";
import { execa } from "execa";
import { v4 } from "uuid";

Expand Down Expand Up @@ -362,11 +363,15 @@ ipcMain.handle(
);
downloadsStore.set(item.id, DownloadState.DONE);
const keyPath = item.destination.replaceAll("/", ".");
pushToStore(inventoryStore, keyPath, {
id: item.id,
modelPath,
label: item.label,
});
pushToStore(
inventoryStore as unknown as ElectronStore<Record<string, unknown>>,
keyPath,
{
id: item.id,
modelPath,
label: item.label,
}
);
if (apps[item.appId]) {
apps[item.appId]?.webContents.send("downloadComplete", true);
}
Expand Down
3 changes: 1 addition & 2 deletions src/electron/helpers/ipc/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { buildKey } from "#/build-key";
import { ID } from "#/enums";
import manifest from "#/manifest.json";
import type { Resource } from "#/types/install";
import type { Manifest } from "#/types/manifest";
import { appSettingsStore } from "@/stores";
import { getCaptainData, getCaptainDownloads, getDirectory } from "@/utils/path-helpers";
import { unpack } from "@/utils/unpack";
Expand All @@ -19,7 +18,7 @@ ipcMain.on(buildKey([ID.INSTALL], { suffix: ":start" }), async _event => {
}

// Get the needed updates
const updates: Resource[] = checkUpdates(manifest as Manifest, "windows");
const updates: Resource[] = checkUpdates(manifest, "windows");

try {
const items: Promise<void>[] = [];
Expand Down

0 comments on commit 4afb7d4

Please sign in to comment.