Skip to content

Commit 4f55e20

Browse files
committed
fix: 修复复制相同内容时分组错误导致的空白问题
1 parent ec60ceb commit 4f55e20

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/hooks/useClipboard.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,23 @@ export const useClipboard = (
6868
return qb.where("type", "=", type).where("value", "=", value);
6969
});
7070

71+
const visible = state.group === "all" || state.group === group;
72+
7173
if (matched) {
7274
if (!clipboardStore.content.autoSort) return;
7375

7476
const { id } = matched;
7577

76-
const [targetItem] = remove(state.list, { id });
78+
if (visible) {
79+
remove(state.list, { id });
7780

78-
state.list.unshift({ ...targetItem, createTime });
81+
state.list.unshift({ ...matched, createTime });
82+
}
7983

8084
return updateHistory(id, { createTime });
8185
}
8286

83-
if (state.group === "all" || state.group === group) {
87+
if (visible) {
8488
state.list.unshift(data);
8589
}
8690

0 commit comments

Comments
 (0)