mirror of
https://github.com/Kuingsmile/PicList.git
synced 2025-01-23 14:48:13 -05:00
🐛 Fix: fix an issue that clipboard listening is not working in windows
This commit is contained in:
parent
0c21017e87
commit
08004561c0
@ -46,7 +46,6 @@
|
|||||||
"ali-oss": "^6.17.1",
|
"ali-oss": "^6.17.1",
|
||||||
"aws-sdk": "^2.1373.0",
|
"aws-sdk": "^2.1373.0",
|
||||||
"axios": "^1.3.4",
|
"axios": "^1.3.4",
|
||||||
"clipboard-event": "^1.6.0",
|
|
||||||
"compare-versions": "^4.1.3",
|
"compare-versions": "^4.1.3",
|
||||||
"core-js": "^3.27.1",
|
"core-js": "^3.27.1",
|
||||||
"cos-nodejs-sdk-v5": "^2.11.19",
|
"cos-nodejs-sdk-v5": "^2.11.19",
|
||||||
|
@ -19,7 +19,6 @@ import { ensureFilePath, handleCopyUrl } from '~/main/utils/common'
|
|||||||
import { T } from '~/main/i18n'
|
import { T } from '~/main/i18n'
|
||||||
import { isMacOSVersionGreaterThanOrEqualTo } from '~/main/utils/getMacOSVersion'
|
import { isMacOSVersionGreaterThanOrEqualTo } from '~/main/utils/getMacOSVersion'
|
||||||
import { buildPicBedListMenu } from '~/main/events/remotes/menu'
|
import { buildPicBedListMenu } from '~/main/events/remotes/menu'
|
||||||
import clipboardListener from 'clipboard-event'
|
|
||||||
import clipboardPoll from '~/main/utils/clipboardPoll'
|
import clipboardPoll from '~/main/utils/clipboardPoll'
|
||||||
import picgo from '../../core/picgo'
|
import picgo from '../../core/picgo'
|
||||||
import { uploadClipboardFiles } from '../uploader/apis'
|
import { uploadClipboardFiles } from '../uploader/apis'
|
||||||
@ -133,7 +132,7 @@ export function createMenu () {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function createContextMenu () {
|
export function createContextMenu () {
|
||||||
const ClipboardWatcher = process.platform === 'win32' ? clipboardListener : clipboardPoll
|
const ClipboardWatcher = 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()
|
||||||
|
@ -15,7 +15,6 @@ import { PicGo as PicGoCore } from 'piclist'
|
|||||||
import { T } from '~/main/i18n'
|
import { T } from '~/main/i18n'
|
||||||
import { changeCurrentUploader } from '~/main/utils/handleUploaderConfig'
|
import { changeCurrentUploader } from '~/main/utils/handleUploaderConfig'
|
||||||
import db from '~/main/apis/core/datastore'
|
import db from '~/main/apis/core/datastore'
|
||||||
import clipboardListener from 'clipboard-event'
|
|
||||||
import clipboardPoll from '~/main/utils/clipboardPoll'
|
import clipboardPoll from '~/main/utils/clipboardPoll'
|
||||||
interface GuiMenuItem {
|
interface GuiMenuItem {
|
||||||
label: string
|
label: string
|
||||||
@ -24,7 +23,7 @@ interface GuiMenuItem {
|
|||||||
|
|
||||||
const buildMiniPageMenu = () => {
|
const buildMiniPageMenu = () => {
|
||||||
const isListeningClipboard = db.get('settings.isListeningClipboard') || false
|
const isListeningClipboard = db.get('settings.isListeningClipboard') || false
|
||||||
const ClipboardWatcher = process.platform === 'win32' ? clipboardListener : clipboardPoll
|
const ClipboardWatcher = clipboardPoll
|
||||||
const submenu = buildPicBedListMenu()
|
const submenu = buildPicBedListMenu()
|
||||||
const template = [
|
const template = [
|
||||||
{
|
{
|
||||||
|
@ -43,7 +43,6 @@ import UpDownTaskQueue from '../manage/datastore/upDownTaskQueue'
|
|||||||
import { T } from '~/main/i18n'
|
import { T } from '~/main/i18n'
|
||||||
import { UpdateInfo, autoUpdater } from 'electron-updater'
|
import { UpdateInfo, autoUpdater } from 'electron-updater'
|
||||||
import updateChecker from '../utils/updateChecker'
|
import updateChecker from '../utils/updateChecker'
|
||||||
import clipboardListener from 'clipboard-event'
|
|
||||||
import clipboardPoll from '../utils/clipboardPoll'
|
import clipboardPoll from '../utils/clipboardPoll'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import { CLIPBOARD_IMAGE_FOLDER } from '~/universal/utils/static'
|
import { CLIPBOARD_IMAGE_FOLDER } from '~/universal/utils/static'
|
||||||
@ -133,7 +132,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 === 'win32' ? clipboardListener : clipboardPoll
|
const ClipboardWatcher = clipboardPoll
|
||||||
if (isAutoListenClipboard) {
|
if (isAutoListenClipboard) {
|
||||||
db.set('settings.isListeningClipboard', true)
|
db.set('settings.isListeningClipboard', true)
|
||||||
ClipboardWatcher.startListening()
|
ClipboardWatcher.startListening()
|
||||||
|
1
src/universal/types/shims-module.d.ts
vendored
1
src/universal/types/shims-module.d.ts
vendored
@ -8,4 +8,3 @@ declare module '*.vue' {
|
|||||||
// function fixPath(): void
|
// function fixPath(): void
|
||||||
// export default fixPath
|
// export default fixPath
|
||||||
// }
|
// }
|
||||||
declare module 'clipboard-event'
|
|
||||||
|
@ -5313,11 +5313,6 @@ cli-width@^2.0.0:
|
|||||||
resolved "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48"
|
resolved "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48"
|
||||||
integrity sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw==
|
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:
|
clipboardy@^2.3.0:
|
||||||
version "2.3.0"
|
version "2.3.0"
|
||||||
resolved "https://registry.npmjs.org/clipboardy/-/clipboardy-2.3.0.tgz#3c2903650c68e46a91b388985bc2774287dba290"
|
resolved "https://registry.npmjs.org/clipboardy/-/clipboardy-2.3.0.tgz#3c2903650c68e46a91b388985bc2774287dba290"
|
||||||
|
Loading…
Reference in New Issue
Block a user