Fix the small mechanical rules. [skip build]
This commit is contained in:
@@ -134,7 +134,6 @@ export const focusWindow = async (): Promise<void> => {
|
||||
if (electron?.window?.focus) {
|
||||
await electron.window.focus();
|
||||
}
|
||||
return;
|
||||
} catch (err) {
|
||||
console.warn('Failed to focus Electron window:', err);
|
||||
}
|
||||
@@ -426,12 +425,12 @@ export const readClipboardImage = async (): Promise<File | null> => {
|
||||
if (electron?.clipboard?.readImage) {
|
||||
const result = await electron.clipboard.readImage();
|
||||
// IPC may return a data URL string or { success, data } depending on path.
|
||||
const dataUrl =
|
||||
typeof result === 'string'
|
||||
? result
|
||||
: result && typeof result === 'object' && typeof result.data === 'string'
|
||||
? result.data
|
||||
: null;
|
||||
let dataUrl = null;
|
||||
if (typeof result === 'string') {
|
||||
dataUrl = result;
|
||||
} else if (result && typeof result === 'object' && typeof result.data === 'string') {
|
||||
dataUrl = result.data;
|
||||
}
|
||||
if (!dataUrl) return null;
|
||||
|
||||
// Convert data URL to File
|
||||
|
||||
Reference in New Issue
Block a user