mirror of
https://github.com/shuaiplus/nodewarden.git
synced 2026-09-19 11:10:12 +00:00
fix: keep duplicate group indices unique when selecting duplicates (#351)
The duplicate group index was capped with '% 64' to limit color slots, but the same index is used as the group identity in 'select unique items from duplicates'. With more than 64 duplicate groups the indices wrap around, so later groups had every item selected (nothing kept). Drop the modulo so each group keeps a unique index; colors still differ via the golden-angle hue.
This commit is contained in:
@@ -382,7 +382,9 @@ export default function VaultPage(props: VaultPageProps) {
|
|||||||
}
|
}
|
||||||
const groupIndexByKey = new Map<string, number>();
|
const groupIndexByKey = new Map<string, number>();
|
||||||
Array.from(groupKeys).sort().forEach((groupKey, index) => {
|
Array.from(groupKeys).sort().forEach((groupKey, index) => {
|
||||||
groupIndexByKey.set(groupKey, index % 64);
|
// Keep indices unique (no modulo): they are used both for group colors and
|
||||||
|
// as the group identity when selecting duplicate items to delete.
|
||||||
|
groupIndexByKey.set(groupKey, index);
|
||||||
});
|
});
|
||||||
const byId = new Map<string, number>();
|
const byId = new Map<string, number>();
|
||||||
for (const [cipherId, groupKey] of groupKeyById.entries()) {
|
for (const [cipherId, groupKey] of groupKeyById.entries()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user