From 79b60b89a543773ab05392fd2b90db04ae5020ef Mon Sep 17 00:00:00 2001 From: muwoo <2424880409@qq.com> Date: Mon, 27 Sep 2021 19:07:49 +0800 Subject: [PATCH 1/2] =?UTF-8?q?ref:=20=E6=94=AF=E6=8C=81=E6=96=B0api?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/preload.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/static/preload.js b/static/preload.js index 7a81156..0f794d8 100644 --- a/static/preload.js +++ b/static/preload.js @@ -239,6 +239,7 @@ window.rubick = { removeFeature(code) { ipcRenderer.sendToHost('removeFeature', {code}); + return true; }, // 系统 shellOpenExternal(url) { @@ -253,6 +254,10 @@ window.rubick = { return os.type() === 'Windows_NT'; }, + isLinux() { + return os.type() === 'Linux'; + }, + shellOpenPath(path) { shell.openPath(path) }, From 50452bc36bb1aa704610294fb309310afafac54d Mon Sep 17 00:00:00 2001 From: muwoo <2424880409@qq.com> Date: Tue, 28 Sep 2021 11:25:51 +0800 Subject: [PATCH 2/2] =?UTF-8?q?bugfix:=20[48];=20win=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=87=BA=E7=8E=B0=E5=8D=B8=E8=BD=BD=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E9=97=AE=E9=A2=98=E3=80=82=20ref:=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96rubick=20removeFeature=20API?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/common/monitor.js | 10 +--------- src/renderer/assets/common/win-app.js | 2 +- static/preload.js | 4 +++- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/main/common/monitor.js b/src/main/common/monitor.js index 8ef56a0..caeca36 100644 --- a/src/main/common/monitor.js +++ b/src/main/common/monitor.js @@ -104,18 +104,10 @@ const touchBar = new TouchBar({ ] }) -let intervalObj; - const start = (window) => { - window.on('blur', () => { - clearInterval(intervalObj); - }); window.on('focus', () => { - intervalObj = setInterval(() => { - updateData(); - }, 1000); + updateData(); }); - updateData(); } export default { diff --git a/src/renderer/assets/common/win-app.js b/src/renderer/assets/common/win-app.js index 32abdc1..22e9966 100644 --- a/src/renderer/assets/common/win-app.js +++ b/src/renderer/assets/common/win-app.js @@ -47,7 +47,7 @@ function fileDisplay(filePath){ const appName = filename.split('.')[0]; const keyWords = [appName]; const appDetail = shell.readShortcutLink(filedir); - if (!appDetail.target) return; + if (!appDetail.target || appDetail.target.toLowerCase().indexOf('unin') >= 0) return; if (isZhRegex.test(appName)) { const py = translate(appName); diff --git a/static/preload.js b/static/preload.js index 0f794d8..029d478 100644 --- a/static/preload.js +++ b/static/preload.js @@ -225,10 +225,12 @@ window.rubick = { isDarkColors() { return false; }, + features: [], getFeatures() { ipcRenderer.sendToHost('getFeatures'); return new Promise(resolve => { ipcRenderer.on(`msg-back-getFeatures`, (e, result) => { + rubick.features = result; resolve(result); }); }); @@ -239,7 +241,7 @@ window.rubick = { removeFeature(code) { ipcRenderer.sendToHost('removeFeature', {code}); - return true; + return !!rubick.features.filter(fe => fe.code === code).length; }, // 系统 shellOpenExternal(url) {