1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-24 04:48:03 +00:00

change search visited item (#7903)

This commit is contained in:
Michael An
2025-06-07 17:28:40 +08:00
committed by GitHub
parent 794dbe0b87
commit 706aa9d421

View File

@@ -354,11 +354,11 @@ class Search extends Component {
keepVisitedItem = (targetItem) => {
let targetIndex;
const storeKey = this.storeKey;
const { repo_id: targetRepoID, path: targetPath } = targetItem;
const storeKey = 'sfVisitedSearchItems' + targetRepoID;
const items = JSON.parse(localStorage.getItem(storeKey)) || [];
for (let i = 0, len = items.length; i < len; i++) {
const { repo_id, path } = items[i];
const { repo_id: targetRepoID, path: targetPath } = targetItem;
if (repo_id == targetRepoID && path == targetPath) {
targetIndex = i;
break;