Fix model

This commit is contained in:
KoalaSat 2023-11-19 09:00:04 +01:00
parent 4b46e3622e
commit 8082da17e7
No known key found for this signature in database
GPG Key ID: 2F7F61C6146AB157

View File

@ -1,6 +1,5 @@
import { type RelayMetadata } from '../../DatabaseFunctions/RelayMetadatas'
import { type Relay } from '../../DatabaseFunctions/Relays'
import { median } from '../../NativeFunctions'
import { getRTags } from '../Events'
export interface ResilientAssignation {
@ -24,6 +23,9 @@ export const getContactsRelays: (
const urls = rTags.map((tags) => tags[1])
urls.forEach((url) => {
if (!localhostRegExp.test(url)) {
if (url.endsWith('/')) {
url = url.slice(0, -1);
}
relaysPresence[url] = [...(relaysPresence[url] ?? []), metadata.pubkey]
}
})