Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add electronAPI.isFirstTimeSetup #215

Merged
merged 1 commit into from
Nov 10, 2024
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
1 change: 1 addition & 0 deletions src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export const IPC_CHANNELS = {
OPEN_LOGS_PATH: 'open-logs-path',
OPEN_DEV_TOOLS: 'open-dev-tools',
OPEN_FORUM: 'open-forum',
IS_FIRST_TIME_SETUP: 'is-first-time-setup',
} as const;

export enum ProgressStatus {
Expand Down
4 changes: 3 additions & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,9 @@ if (!gotTheLock) {
ipcMain.on(IPC_CHANNELS.OPEN_DEV_TOOLS, () => {
appWindow.openDevTools();
});

ipcMain.handle(IPC_CHANNELS.IS_FIRST_TIME_SETUP, () => {
return isFirstTimeSetup();
});
await handleFirstTimeSetup();
const basePath = await getBasePath();
const pythonInstallPath = await getPythonInstallPath();
Expand Down
6 changes: 6 additions & 0 deletions src/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,12 @@ const electronAPI = {
extras,
});
},
/**
* Check if the user has completed the first time setup wizard.
*/
isFirstTimeSetup: (): Promise<boolean> => {
return ipcRenderer.invoke(IPC_CHANNELS.IS_FIRST_TIME_SETUP);
},
} as const;

export type ElectronAPI = typeof electronAPI;
Expand Down
Loading