Skip to content

Commit

Permalink
Fix imports.
Browse files Browse the repository at this point in the history
  • Loading branch information
robinjhuang committed Nov 9, 2024
1 parent 77b5dde commit 75d64dc
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/handlers/pathHandlers.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
import { app, ipcMain, shell } from 'electron';
import { IPC_CHANNELS } from '../constants';
import { determineResourcesPaths } from '../main';
import log from 'electron-log/main';
import { getModelConfigPath } from '../config/extra_model_config';
import { getBasePath } from '../install/resourcePaths';

export class PathHandlers {
constructor() {}

registerHandlers() {
ipcMain.on(IPC_CHANNELS.OPEN_LOGS_PATH, () => {
ipcMain.on(IPC_CHANNELS.OPEN_LOGS_PATH, (): void => {
shell.openPath(app.getPath('logs'));
});

ipcMain.handle(IPC_CHANNELS.GET_MODEL_CONFIG_PATH, () => {
ipcMain.handle(IPC_CHANNELS.GET_MODEL_CONFIG_PATH, (): string => {
return getModelConfigPath();
});

ipcMain.handle(IPC_CHANNELS.GET_BASE_PATH, async () => {
const { basePath } = await determineResourcesPaths();
return basePath;
ipcMain.handle(IPC_CHANNELS.GET_BASE_PATH, async (): Promise<string | null> => {
return getBasePath();
});

ipcMain.on(IPC_CHANNELS.OPEN_PATH, (event, folderPath: string) => {
ipcMain.on(IPC_CHANNELS.OPEN_PATH, (event, folderPath: string): void => {
log.info(`Opening path: ${folderPath}`);
shell.openPath(folderPath);
});
Expand Down

0 comments on commit 75d64dc

Please sign in to comment.