From 75ccc5f5f2e5b389c43fe94c9a01ad420571499f Mon Sep 17 00:00:00 2001 From: ZiuChen <457353192@qq.com> Date: Mon, 15 Aug 2022 12:52:55 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=BC=A0=E6=A0=87=E7=82=B9=E5=87=BB?= =?UTF-8?q?=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95=E5=90=8E=E9=80=80=E5=87=BA?= =?UTF-8?q?=E6=8F=92=E4=BB=B6=E5=B9=B6=E9=9A=90=E8=97=8F=E4=B8=BB=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/preload.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/public/preload.js b/public/preload.js index 6c24fbe..ff76672 100644 --- a/public/preload.js +++ b/public/preload.js @@ -102,7 +102,7 @@ class DB { } // inu1255: pbpaste & watchClipboard -function pbpaste() { +const pbpaste = () => { const files = utools.getCopyedFiles() // null | Array if (files) { return { @@ -121,7 +121,7 @@ function pbpaste() { if (text.trim()) return { type: 'text', data: text } } -function watchClipboard(db, fn) { +const watchClipboard = (db, fn) => { let prev = db.dataBase.data[0] || {} setInterval(() => { const item = pbpaste() @@ -137,7 +137,7 @@ function watchClipboard(db, fn) { }, 500) } -function copy(item) { +const copy = (item) => { switch (item.type) { case 'text': clipboard.writeText(item.data) @@ -152,6 +152,7 @@ function copy(item) { break } utools.outPlugin() + utools.hideMainWindow() } const path = `${home}\\${dbName}`