Skip to content

修复历史记录重合问题 #38

Merged
merged 2 commits into from
Mar 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
1 change: 0 additions & 1 deletion src/routers/layout/search/pc/modal.tsx

This file was deleted.

8 changes: 6 additions & 2 deletions src/routers/layout/search/pc/searchSuggest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ type PCTagSuggestProps = {
const PCTagStorage = new Storage<string[]>("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(
Expand Down Expand Up @@ -101,7 +103,9 @@ export const PCTagSuggest: FC<PCTagSuggestProps> = ({
const PCNameStorage = new Storage<string[]>("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(
Expand Down