mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-02 04:12:47 +02:00
feat: add permission onboarding page and startup routing for macOS
This commit is contained in:
parent
ec2b7851b6
commit
eaabad38fc
7 changed files with 228 additions and 7 deletions
|
|
@ -7,6 +7,7 @@ import { setupAutoUpdater } from './modules/auto-updater';
|
|||
import { setupMenu } from './modules/menu';
|
||||
import { registerQuickAsk, unregisterQuickAsk } from './modules/quick-ask';
|
||||
import { registerIpcHandlers } from './ipc/handlers';
|
||||
import { allPermissionsGranted } from './modules/permissions';
|
||||
|
||||
registerGlobalErrorHandlers();
|
||||
|
||||
|
|
@ -16,7 +17,13 @@ if (!setupDeepLinks()) {
|
|||
|
||||
registerIpcHandlers();
|
||||
|
||||
// App lifecycle
|
||||
function getInitialPath(): string {
|
||||
if (process.platform === 'darwin' && !allPermissionsGranted()) {
|
||||
return '/desktop/permissions';
|
||||
}
|
||||
return '/dashboard';
|
||||
}
|
||||
|
||||
app.whenReady().then(async () => {
|
||||
setupMenu();
|
||||
try {
|
||||
|
|
@ -26,7 +33,9 @@ app.whenReady().then(async () => {
|
|||
setTimeout(() => app.quit(), 0);
|
||||
return;
|
||||
}
|
||||
createMainWindow();
|
||||
|
||||
const initialPath = getInitialPath();
|
||||
createMainWindow(initialPath);
|
||||
registerQuickAsk();
|
||||
setupAutoUpdater();
|
||||
|
||||
|
|
@ -34,7 +43,7 @@ app.whenReady().then(async () => {
|
|||
|
||||
app.on('activate', () => {
|
||||
if (BrowserWindow.getAllWindows().length === 0) {
|
||||
createMainWindow();
|
||||
createMainWindow(getInitialPath());
|
||||
}
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue