🔨 Refactor: change linux clipboard watcher

This commit is contained in:
萌萌哒赫萝 2023-04-11 09:31:10 +08:00
parent 6c18bcb130
commit c6fcf0e551
2 changed files with 2 additions and 2 deletions

View File

@ -113,7 +113,7 @@ export function createMenu () {
} }
export function createContextMenu () { export function createContextMenu () {
const ClipboardWatcher = process.platform === 'darwin' ? clipboardPoll : clipboardListener const ClipboardWatcher = process.platform === 'win32' ? clipboardListener : clipboardPoll
const isListeningClipboard = db.get('settings.isListeningClipboard') || false const isListeningClipboard = db.get('settings.isListeningClipboard') || false
if (process.platform === 'darwin' || process.platform === 'win32') { if (process.platform === 'darwin' || process.platform === 'win32') {
const submenu = buildPicBedListMenu() const submenu = buildPicBedListMenu()

View File

@ -142,7 +142,7 @@ class LifeCycle {
windowManager.create(IWindowList.TRAY_WINDOW) windowManager.create(IWindowList.TRAY_WINDOW)
windowManager.create(IWindowList.SETTING_WINDOW) windowManager.create(IWindowList.SETTING_WINDOW)
const isAutoListenClipboard = db.get('settings.isAutoListenClipboard') || false const isAutoListenClipboard = db.get('settings.isAutoListenClipboard') || false
const ClipboardWatcher = process.platform === 'darwin' ? clipboardPoll : clipboardListener const ClipboardWatcher = process.platform === 'win32' ? clipboardListener : clipboardPoll
if (isAutoListenClipboard) { if (isAutoListenClipboard) {
db.set('settings.isListeningClipboard', true) db.set('settings.isListeningClipboard', true)
ClipboardWatcher.startListening() ClipboardWatcher.startListening()