Skip to content

Commit

Permalink
Merge pull request #38 from EOEFANS/main
Browse files Browse the repository at this point in the history
修复历史记录重合问题
  • Loading branch information
master1lan authored and GitHub Enterprise committed Mar 5, 2023
2 parents cb6e3be + 404a588 commit f5f2f6c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
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

0 comments on commit f5f2f6c

Please sign in to comment.