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", 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(