mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 16:56:22 +02:00
feat(web): add ElectronAPI type declaration for window.electronAPI
This commit is contained in:
parent
9e058e1329
commit
d6d4ebc75d
2 changed files with 15 additions and 1 deletions
|
|
@ -317,7 +317,7 @@ const Composer: FC = () => {
|
|||
// Clipboard content
|
||||
const [clipboardText, setClipboardText] = useState<string | undefined>();
|
||||
useEffect(() => {
|
||||
const api = (window as { electronAPI?: { getClipboardContent?: () => Promise<string> } }).electronAPI;
|
||||
const api = window.electronAPI;
|
||||
if (!api?.getClipboardContent) return;
|
||||
api.getClipboardContent().then((text) => {
|
||||
if (text) setClipboardText(text);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue