🐛 Fix: fix an issue that clipboard listening is not working in windows

This commit is contained in:
萌萌哒赫萝 2023-05-24 17:14:21 +08:00
parent 0c21017e87
commit 08004561c0
6 changed files with 3 additions and 13 deletions

View File

@ -46,7 +46,6 @@
"ali-oss": "^6.17.1",
"aws-sdk": "^2.1373.0",
"axios": "^1.3.4",
"clipboard-event": "^1.6.0",
"compare-versions": "^4.1.3",
"core-js": "^3.27.1",
"cos-nodejs-sdk-v5": "^2.11.19",

View File

@ -19,7 +19,6 @@ import { ensureFilePath, handleCopyUrl } from '~/main/utils/common'
import { T } from '~/main/i18n'
import { isMacOSVersionGreaterThanOrEqualTo } from '~/main/utils/getMacOSVersion'
import { buildPicBedListMenu } from '~/main/events/remotes/menu'
import clipboardListener from 'clipboard-event'
import clipboardPoll from '~/main/utils/clipboardPoll'
import picgo from '../../core/picgo'
import { uploadClipboardFiles } from '../uploader/apis'
@ -133,7 +132,7 @@ export function createMenu () {
}
export function createContextMenu () {
const ClipboardWatcher = process.platform === 'win32' ? clipboardListener : clipboardPoll
const ClipboardWatcher = clipboardPoll
const isListeningClipboard = db.get('settings.isListeningClipboard') || false
if (process.platform === 'darwin' || process.platform === 'win32') {
const submenu = buildPicBedListMenu()

View File

@ -15,7 +15,6 @@ import { PicGo as PicGoCore } from 'piclist'
import { T } from '~/main/i18n'
import { changeCurrentUploader } from '~/main/utils/handleUploaderConfig'
import db from '~/main/apis/core/datastore'
import clipboardListener from 'clipboard-event'
import clipboardPoll from '~/main/utils/clipboardPoll'
interface GuiMenuItem {
label: string
@ -24,7 +23,7 @@ interface GuiMenuItem {
const buildMiniPageMenu = () => {
const isListeningClipboard = db.get('settings.isListeningClipboard') || false
const ClipboardWatcher = process.platform === 'win32' ? clipboardListener : clipboardPoll
const ClipboardWatcher = clipboardPoll
const submenu = buildPicBedListMenu()
const template = [
{

View File

@ -43,7 +43,6 @@ import UpDownTaskQueue from '../manage/datastore/upDownTaskQueue'
import { T } from '~/main/i18n'
import { UpdateInfo, autoUpdater } from 'electron-updater'
import updateChecker from '../utils/updateChecker'
import clipboardListener from 'clipboard-event'
import clipboardPoll from '../utils/clipboardPoll'
import path from 'path'
import { CLIPBOARD_IMAGE_FOLDER } from '~/universal/utils/static'
@ -133,7 +132,7 @@ class LifeCycle {
windowManager.create(IWindowList.TRAY_WINDOW)
windowManager.create(IWindowList.SETTING_WINDOW)
const isAutoListenClipboard = db.get('settings.isAutoListenClipboard') || false
const ClipboardWatcher = process.platform === 'win32' ? clipboardListener : clipboardPoll
const ClipboardWatcher = clipboardPoll
if (isAutoListenClipboard) {
db.set('settings.isListeningClipboard', true)
ClipboardWatcher.startListening()

View File

@ -8,4 +8,3 @@ declare module '*.vue' {
// function fixPath(): void
// export default fixPath
// }
declare module 'clipboard-event'

View File

@ -5313,11 +5313,6 @@ cli-width@^2.0.0:
resolved "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48"
integrity sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==
clipboard-event@^1.6.0:
version "1.6.0"
resolved "https://registry.npmjs.org/clipboard-event/-/clipboard-event-1.6.0.tgz#2cd6c6d469b635e3d9be73e2d0cc554cdf17f3d5"
integrity sha512-a69QYimd43xM+5hcHkucs0V/QoiZz1fqEFRTnewOITVQOtypRLbCx76Q91Djn6h7O24817dQw44sFUxRYWIuYA==
clipboardy@^2.3.0:
version "2.3.0"
resolved "https://registry.npmjs.org/clipboardy/-/clipboardy-2.3.0.tgz#3c2903650c68e46a91b388985bc2774287dba290"