Files
vikunja/desktop/preload.js
kolaente bc47826690 feat(frontend): add configurable quick entry shortcut setting
Add desktopQuickEntryShortcut to frontend settings with a Desktop
App section in General settings, only visible when running in the
Electron app. The setting syncs to the desktop main process via
IPC whenever settings are loaded or saved.
2026-04-01 21:38:38 +00:00

17 lines
731 B
JavaScript

const {contextBridge, ipcRenderer} = require('electron')
contextBridge.exposeInMainWorld('vikunjaDesktop', {
startOAuthLogin: (apiUrl) => ipcRenderer.invoke('oauth:start-login', apiUrl),
onOAuthTokens: (callback) => {
ipcRenderer.removeAllListeners('oauth:tokens')
ipcRenderer.on('oauth:tokens', (_event, tokens) => callback(tokens))
},
onOAuthError: (callback) => {
ipcRenderer.removeAllListeners('oauth:error')
ipcRenderer.on('oauth:error', (_event, error) => callback(error))
},
refreshToken: (apiUrl, refreshToken) => ipcRenderer.invoke('oauth:refresh-token', apiUrl, refreshToken),
updateQuickEntryShortcut: (shortcut) => ipcRenderer.send('desktop:update-quick-entry-shortcut', shortcut),
isDesktop: true,
})