From c6fcf0e55149c15764034de5cc1b2b145d309ae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=8C=E8=90=8C=E5=93=92=E8=B5=AB=E8=90=9D?= Date: Tue, 11 Apr 2023 09:31:10 +0800 Subject: [PATCH] :hammer: Refactor: change linux clipboard watcher --- src/main/apis/app/system/index.ts | 2 +- src/main/lifeCycle/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/apis/app/system/index.ts b/src/main/apis/app/system/index.ts index d8237d6..878bce5 100644 --- a/src/main/apis/app/system/index.ts +++ b/src/main/apis/app/system/index.ts @@ -113,7 +113,7 @@ export function createMenu () { } export function createContextMenu () { - const ClipboardWatcher = process.platform === 'darwin' ? clipboardPoll : clipboardListener + const ClipboardWatcher = process.platform === 'win32' ? clipboardListener : clipboardPoll const isListeningClipboard = db.get('settings.isListeningClipboard') || false if (process.platform === 'darwin' || process.platform === 'win32') { const submenu = buildPicBedListMenu() diff --git a/src/main/lifeCycle/index.ts b/src/main/lifeCycle/index.ts index dce3baa..92194af 100644 --- a/src/main/lifeCycle/index.ts +++ b/src/main/lifeCycle/index.ts @@ -142,7 +142,7 @@ class LifeCycle { windowManager.create(IWindowList.TRAY_WINDOW) windowManager.create(IWindowList.SETTING_WINDOW) const isAutoListenClipboard = db.get('settings.isAutoListenClipboard') || false - const ClipboardWatcher = process.platform === 'darwin' ? clipboardPoll : clipboardListener + const ClipboardWatcher = process.platform === 'win32' ? clipboardListener : clipboardPoll if (isAutoListenClipboard) { db.set('settings.isListeningClipboard', true) ClipboardWatcher.startListening()