mirror of
https://github.com/Kuingsmile/PicList.git
synced 2026-05-22 16:50:35 +08:00
🐛 Fix: fix repeated upload bug when listening clipboard
This commit is contained in:
@@ -13,7 +13,6 @@ class ClipboardWatcher extends EventEmitter {
|
||||
|
||||
startListening (watchDelay = 500) {
|
||||
this.stopListening()
|
||||
console.log('timer', this.timer)
|
||||
|
||||
const image = clipboard.readImage()
|
||||
if (!image.isEmpty()) {
|
||||
@@ -40,12 +39,10 @@ class ClipboardWatcher extends EventEmitter {
|
||||
this.lastImage = currentImage
|
||||
this.emit('change', currentImage)
|
||||
}, watchDelay)
|
||||
console.log('start timer', this.timer)
|
||||
}
|
||||
|
||||
stopListening () {
|
||||
if (this.timer) {
|
||||
console.log('stop timer')
|
||||
clearInterval(this.timer)
|
||||
this.timer = null
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user