mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-11 16:52:38 +02:00
feat: add auto-launch functionality for desktop app
- Implemented IPC channels for managing auto-launch settings. - Enhanced main process to handle auto-launch behavior on startup. - Updated UI components to allow users to configure launch options. - Integrated analytics tracking for auto-launch events. This commit introduces the ability for users to enable or disable the application launching at system startup, along with options for starting minimized to the tray.
This commit is contained in:
parent
7a389e7a25
commit
24383a3741
9 changed files with 493 additions and 17 deletions
|
|
@ -24,6 +24,7 @@ import {
|
|||
type WatchedFolderConfig,
|
||||
} from '../modules/folder-watcher';
|
||||
import { getShortcuts, setShortcuts, type ShortcutConfig } from '../modules/shortcuts';
|
||||
import { getAutoLaunchState, setAutoLaunch } from '../modules/auto-launch';
|
||||
import { getActiveSearchSpaceId, setActiveSearchSpaceId } from '../modules/active-search-space';
|
||||
import { reregisterQuickAsk } from '../modules/quick-ask';
|
||||
import { reregisterAutocomplete } from '../modules/autocomplete';
|
||||
|
|
@ -127,6 +128,21 @@ export function registerIpcHandlers(): void {
|
|||
|
||||
ipcMain.handle(IPC_CHANNELS.GET_SHORTCUTS, () => getShortcuts());
|
||||
|
||||
ipcMain.handle(IPC_CHANNELS.GET_AUTO_LAUNCH, () => getAutoLaunchState());
|
||||
|
||||
ipcMain.handle(
|
||||
IPC_CHANNELS.SET_AUTO_LAUNCH,
|
||||
async (_event, payload: { enabled: boolean; openAsHidden?: boolean }) => {
|
||||
const next = await setAutoLaunch(payload.enabled, payload.openAsHidden);
|
||||
trackEvent('desktop_auto_launch_toggled', {
|
||||
enabled: next.enabled,
|
||||
open_as_hidden: next.openAsHidden,
|
||||
supported: next.supported,
|
||||
});
|
||||
return next;
|
||||
},
|
||||
);
|
||||
|
||||
ipcMain.handle(IPC_CHANNELS.GET_ACTIVE_SEARCH_SPACE, () => getActiveSearchSpaceId());
|
||||
|
||||
ipcMain.handle(IPC_CHANNELS.SET_ACTIVE_SEARCH_SPACE, (_event, id: string) =>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue