mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-26 03:31:24 +08:00
Update src/renderer/src/windows/screenshot/ScreenshotSelection.tsx
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
9f16630512
commit
1ad083511a
@ -63,6 +63,14 @@ const ScreenshotSelection = () => {
|
||||
ctx.drawImage(img, 0, 0, canvas.width, canvas.height)
|
||||
logger.info('Screenshot drawn on canvas')
|
||||
}
|
||||
img.onerror = (e) => {
|
||||
logger.error('Failed to load screenshot image', { error: e, screenshotData });
|
||||
// Optionally, notify the user or close the selection window gracefully
|
||||
// For example, close the window:
|
||||
if (window.electron && window.electron.ipcRenderer) {
|
||||
window.electron.ipcRenderer.send(IpcChannel.Screenshot_CloseSelectionWindow);
|
||||
}
|
||||
}
|
||||
img.src = screenshotData
|
||||
}, [screenshotData])
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user