From f40065815c75a046e752168d15e1718ba91bceff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E4=B8=80=E4=B9=8B?= Date: Mon, 14 Aug 2023 23:49:57 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20=E9=A6=96=E6=AC=A1=E8=BF=9B?= =?UTF-8?q?=E5=85=A5=E6=97=B6=E6=89=93=E5=BC=80=E5=BC=95=E5=AF=BC=E4=B8=8E?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=97=B6=E6=89=93=E5=BC=80=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package-lock.json | 4 +-- package.json | 2 +- src/app/service/subscribe/manager.ts | 4 +-- src/app/service/system/manager.ts | 33 ++-------------------- src/manifest.json | 2 +- src/pages/components/layout/SiderGuide.tsx | 10 +++++-- 6 files changed, 17 insertions(+), 38 deletions(-) diff --git a/package-lock.json b/package-lock.json index 75c7e569..5d1a3286 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "scriptcat", - "version": "0.15.0-beta", + "version": "0.15.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "scriptcat", - "version": "0.15.0-beta", + "version": "0.15.0", "license": "GPLv3", "dependencies": { "@arco-design/web-react": "^2.47.0", diff --git a/package.json b/package.json index f4fa3bce..9f995f05 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "scriptcat", - "version": "0.15.0-beta", + "version": "0.15.0", "description": "脚本猫,一个可以执行用户脚本的浏览器扩展,万物皆可脚本化,让你的浏览器可以做更多的事情!", "author": "CodFrm", "license": "GPLv3", diff --git a/src/app/service/subscribe/manager.ts b/src/app/service/subscribe/manager.ts index 3e7ba9df..92675fb7 100644 --- a/src/app/service/subscribe/manager.ts +++ b/src/app/service/subscribe/manager.ts @@ -178,11 +178,11 @@ export default class SubscribeManager extends Manager { if ( checkSilenceUpdate( newSubscribe.oldSubscribe!.metadata, - newSubscribe.metadata + newSubscribe.subscribe.metadata ) ) { logger.info("silence update subscribe"); - this.upsertHandler(newSubscribe); + this.upsertHandler(newSubscribe.subscribe); return; } } catch (e) { diff --git a/src/app/service/system/manager.ts b/src/app/service/system/manager.ts index 157c676c..d48bc1a9 100644 --- a/src/app/service/system/manager.ts +++ b/src/app/service/system/manager.ts @@ -60,36 +60,9 @@ export class SystemManager extends Manager { if (details.reason === "install") { chrome.tabs.create({ url: "https://docs.scriptcat.org/" }); } else if (details.reason === "update") { - let nid: string; - chrome.notifications.create( - { - type: "basic", - iconUrl: chrome.runtime.getURL("assets/logo.png"), - title: `ScriptCat 更新到 ${ExtVersion}`, - message: "ScriptCat已更新,点击查看更新日志", - }, - (notificationId) => { - nid = notificationId; - } - ); - // eslint-disable-next-line no-undef - let tm: NodeJS.Timeout; - const onClicked = (id: string) => { - if (nid !== id) { - return; - } - chrome.notifications.onClicked.removeListener(onClicked); - chrome.tabs.create({ - url: `https://docs.scriptcat.org/docs/change/#${ExtVersion}`, - }); - chrome.notifications.clear(nid); - clearTimeout(tm); - }; - tm = setTimeout(() => { - chrome.notifications.clear(nid); - chrome.notifications.onClicked.removeListener(onClicked); - }, 60 * 60 * 1000); - chrome.notifications.onClicked.addListener(onClicked); + chrome.tabs.create({ + url: `https://docs.scriptcat.org/docs/change/#${ExtVersion}`, + }); } }); } diff --git a/src/manifest.json b/src/manifest.json index 1d6efbc5..82ee16db 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,7 +1,7 @@ { "manifest_version": 2, "name": "ScriptCat", - "version": "0.15.0.1010", + "version": "0.15.0", "author": "CodFrm", "description": "脚本猫,一个用户脚本管理器,支持后台脚本、定时脚本、页面脚本,可编写脚本每天帮你自动处理事务.", "options_ui": { diff --git a/src/pages/components/layout/SiderGuide.tsx b/src/pages/components/layout/SiderGuide.tsx index 2960f86d..eaf5c402 100644 --- a/src/pages/components/layout/SiderGuide.tsx +++ b/src/pages/components/layout/SiderGuide.tsx @@ -1,4 +1,4 @@ -import React, { useImperativeHandle, useState } from "react"; +import React, { useEffect, useImperativeHandle, useState } from "react"; import { useTranslation } from "react-i18next"; import Joyride, { Step } from "react-joyride"; import { Path, useLocation, useNavigate } from "react-router-dom"; @@ -17,6 +17,13 @@ const SiderGuide: React.ForwardRefRenderFunction<{ open: () => void }, {}> = ( useImperativeHandle(ref, () => ({ open: () => setRun(true), })); + useEffect(() => { + // 首次使用时,打开引导 + if (localStorage.getItem("firstUse") === null) { + localStorage.setItem("firstUse", "false"); + setRun(true); + } + }); const steps: Array = [ { @@ -91,7 +98,6 @@ const SiderGuide: React.ForwardRefRenderFunction<{ open: () => void }, {}> = ( return ( { - console.log(data); if ( data.action === "stop" || data.action === "close" ||