fix/compose: безопасный fallback для окна в compose:pickFiles
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
393a15fe9f
commit
b775fe06b9
1 changed files with 2 additions and 2 deletions
|
|
@ -57,8 +57,8 @@ ipcMain.handle('compose:getData', (event) => {
|
||||||
})
|
})
|
||||||
|
|
||||||
ipcMain.handle('compose:pickFiles', async (event) => {
|
ipcMain.handle('compose:pickFiles', async (event) => {
|
||||||
const win = BrowserWindow.fromWebContents(event.sender) ?? undefined
|
const win = BrowserWindow.fromWebContents(event.sender)
|
||||||
const result = await dialog.showOpenDialog(win!, {
|
const result = await dialog.showOpenDialog(win ?? app.focusedWindow() ?? BrowserWindow.getAllWindows()[0], {
|
||||||
properties: ['openFile', 'multiSelections'],
|
properties: ['openFile', 'multiSelections'],
|
||||||
title: 'Прикрепить файлы'
|
title: 'Прикрепить файлы'
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue