Update README and code to remove folder registration option

This commit is contained in:
2026-03-20 10:18:12 +01:00
parent d86cb8d0fd
commit c4ee51d05d
5 changed files with 33 additions and 65 deletions

View File

@@ -475,20 +475,9 @@ ipcMain.handle('update-settings', (event, settings) => {
return true
})
function pickDialogProperties(kind) {
if (kind === 'directories') {
return ['openDirectory', 'multiSelections']
}
if (kind === 'mixed') {
return ['openFile', 'openDirectory', 'multiSelections']
}
return ['openFile', 'multiSelections']
}
ipcMain.handle('pick-paths', async (event, options = {}) => {
const kind = typeof options?.kind === 'string' ? options.kind : 'files'
ipcMain.handle('pick-paths', async () => {
const result = await dialog.showOpenDialog(mainWindow, {
properties: pickDialogProperties(kind),
properties: ['openFile', 'multiSelections'],
})
return result.canceled ? [] : result.filePaths
})

View File

@@ -8,7 +8,7 @@ contextBridge.exposeInMainWorld('electronAPI', {
checkForUpdates: () => ipcRenderer.invoke('check-for-updates'),
setSetting: (key, value) => ipcRenderer.invoke('set-setting', key, value),
updateSettings: (settings) => ipcRenderer.invoke('update-settings', settings),
pickPaths: (options = {}) => ipcRenderer.invoke('pick-paths', options),
pickPaths: () => ipcRenderer.invoke('pick-paths'),
openPath: (filePath) => ipcRenderer.invoke('open-path', filePath),
openExternalLink: (event) => {
event.preventDefault();