mirror of
https://github.com/coracle-social/coracle.git
synced 2024-09-29 00:10:52 +00:00
Fix repository delete on duplicate
This commit is contained in:
parent
d3f47950a7
commit
22e6af3dde
@ -55,11 +55,11 @@
|
||||
"@fortawesome/fontawesome-free": "^6.5.2",
|
||||
"@getalby/bitcoin-connect": "^3.2.2",
|
||||
"@scure/base": "^1.1.6",
|
||||
"@welshman/content": "^0.0.2",
|
||||
"@welshman/content": "^0.0.3",
|
||||
"@welshman/feeds": "^0.0.9",
|
||||
"@welshman/lib": "^0.0.8",
|
||||
"@welshman/net": "^0.0.11",
|
||||
"@welshman/util": "^0.0.11",
|
||||
"@welshman/util": "^0.0.12",
|
||||
"classnames": "^2.5.1",
|
||||
"compressorjs": "^1.2.1",
|
||||
"date-picker-svelte": "^2.12.0",
|
||||
|
@ -1,5 +1,5 @@
|
||||
import {derived} from "svelte/store"
|
||||
import {nth, identity, partition, first} from "@welshman/lib"
|
||||
import {nth, uniqBy, identity, partition, first} from "@welshman/lib"
|
||||
import {Repository, Relay, matchFilters, getIdAndAddress, getIdFilters} from "@welshman/util"
|
||||
import type {Filter, TrustedEvent} from "@welshman/util"
|
||||
import {custom} from "src/util/misc"
|
||||
@ -64,10 +64,9 @@ export const deriveEventsMapped = <T>({
|
||||
}
|
||||
}
|
||||
|
||||
const onDelete = (event: TrustedEvent) => {
|
||||
const ids = new Set(event.tags.map(nth(1)))
|
||||
const onDelete = (values: Set<string>) => {
|
||||
const [deleted, ok] = partition(
|
||||
(item: T) => getIdAndAddress(itemToEvent(item)).some(id => ids.has(id)),
|
||||
(item: T) => getIdAndAddress(itemToEvent(item)).some(id => values.has(id)),
|
||||
data,
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user