diff --git a/package.json b/package.json index 1e28b54e..b2d3e22e 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "normalize-url": "^8.0.0", "nostr-tools": "^2.1.5", "npm-run-all": "^4.1.5", - "paravel": "https://github.com/coracle-social/paravel.git#new-tags", + "paravel": "^0.5.0", "qr-scanner": "^1.4.2", "qrcode": "^1.5.3", "ramda": "^0.29.1", diff --git a/src/engine/lists/derived.ts b/src/engine/lists/derived.ts index 831a68cf..ec88f654 100644 --- a/src/engine/lists/derived.ts +++ b/src/engine/lists/derived.ts @@ -9,6 +9,17 @@ export const lists = derivedCollection("address", [_lists, deletes], ([$l, $l.filter(l => !$d.has(l.address)), ) -export const userLists = derivedCollection("address", [lists, pubkey], ([$l, $pk]) => - sortBy((l: any) => (l.title || l.name).toLowerCase(), $l.filter(whereEq({pubkey: $pk}))), -) +export const userLists = derivedCollection("address", [lists, pubkey], ([$l, $pk]) => { + const m = new Map() + const getName = (l: any) => (l.title || l.name).toLowerCase() + + for (const list of $l.filter(whereEq({pubkey: $pk}))) { + const name = getName(list) + + if (!m.has(name) || list.address.startsWith("30003")) { + m.set(name, list) + } + } + + return sortBy(getName, Array.from(m.values())) +}) diff --git a/yarn.lock b/yarn.lock index 59341335..7540cb79 100644 Binary files a/yarn.lock and b/yarn.lock differ