From b9a47957781412703cf1a13094f42aabfa4b358d Mon Sep 17 00:00:00 2001 From: master1lan <278457198@qq.com> Date: Sun, 5 Mar 2023 11:39:29 +0800 Subject: [PATCH 1/2] =?UTF-8?q?:bug:=20fix(custom):=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E5=8E=86=E5=8F=B2=E8=AE=B0=E5=BD=95=E9=87=8D=E5=A4=8D=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ISSUES CLOSED: #37 --- src/routers/layout/search/pc/modal.tsx | 1 - src/routers/layout/search/pc/searchSuggest.tsx | 8 ++++++-- 2 files changed, 6 insertions(+), 3 deletions(-) delete mode 100644 src/routers/layout/search/pc/modal.tsx diff --git a/src/routers/layout/search/pc/modal.tsx b/src/routers/layout/search/pc/modal.tsx deleted file mode 100644 index b3ad8b7..0000000 --- a/src/routers/layout/search/pc/modal.tsx +++ /dev/null @@ -1 +0,0 @@ -export default function PCSearchAdvanceLikeModal() {} diff --git a/src/routers/layout/search/pc/searchSuggest.tsx b/src/routers/layout/search/pc/searchSuggest.tsx index ceb36b2..2032073 100644 --- a/src/routers/layout/search/pc/searchSuggest.tsx +++ b/src/routers/layout/search/pc/searchSuggest.tsx @@ -20,7 +20,9 @@ type PCTagSuggestProps = { const PCTagStorage = new Storage("pcTagHistorys"); export const addPCTagHistory = (value: string) => { const oldHistory = PCTagStorage.getLocalStorage([]); - PCTagStorage.setLocalstorage([value, ...oldHistory.slice(0, 4)]); + PCTagStorage.setLocalstorage( + [value, ...oldHistory.filter((item) => item !== value)].slice(0, 5) + ); }; const usePCTagHistory = () => { const local_history: renderSuggestItemLists = PCTagStorage.getLocalStorage( @@ -101,7 +103,9 @@ export const PCTagSuggest: FC = ({ const PCNameStorage = new Storage("pcNameHistorys"); export const addPCNameHistory = (value: string) => { const oldHistory = PCNameStorage.getLocalStorage([]); - PCNameStorage.setLocalstorage([value, ...oldHistory.slice(0, 4)]); + PCNameStorage.setLocalstorage( + [value, ...oldHistory.filter((item) => item !== value)].slice(0, 5) + ); }; const usePCNameHistory = () => { const local_history: renderSuggestItemLists = PCNameStorage.getLocalStorage( From 404a588a8c51c468fcb54549b6d06b1016f0e558 Mon Sep 17 00:00:00 2001 From: master1lan Date: Sun, 5 Mar 2023 03:45:00 +0000 Subject: [PATCH 2/2] chore(release): 1.0.5 --- CHANGELOG.md | 9 +++++++++ package.json | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 777c06b..006d314 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. +## 1.0.5 (2023-03-05) + + +### 🐛 Bug Fixes + +* **custom**: 修复历史记录重复的问题 ([b9a4795](https://vlink.dev/EOEFANS/eoefans-web/commits/b9a4795)), closes [#37](https://vlink.dev/EOEFANS/eoefans-web/issues/37) + + + ## 1.0.4 (2023-03-05) diff --git a/package.json b/package.json index f69bcc8..9e5558c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eoefans-web", - "version": "1.0.4", + "version": "1.0.5", "type": "module", "scripts": { "dev": "vite --config ./config/vite.dev.config.ts",