|
|
|
@ -26,7 +26,7 @@ export const repo_collections: { |
|
|
|
|
|
|
|
|
|
|
|
export const ensureRepo = ( |
|
|
|
export const ensureRepo = ( |
|
|
|
a: string | NDKEvent, |
|
|
|
a: string | NDKEvent, |
|
|
|
naddr_relays: string[] | undefined = undefined, |
|
|
|
naddr_relays: string[] | undefined = undefined |
|
|
|
): Writable<RepoEvent> => { |
|
|
|
): Writable<RepoEvent> => { |
|
|
|
if (typeof a !== 'string') { |
|
|
|
if (typeof a !== 'string') { |
|
|
|
const repo_event = eventToRepoEvent(a) |
|
|
|
const repo_event = eventToRepoEvent(a) |
|
|
|
@ -107,7 +107,7 @@ export const ensureRepo = ( |
|
|
|
|
|
|
|
|
|
|
|
export const returnRepo = async ( |
|
|
|
export const returnRepo = async ( |
|
|
|
a: string, |
|
|
|
a: string, |
|
|
|
naddr_relays: string[] | undefined = undefined, |
|
|
|
naddr_relays: string[] | undefined = undefined |
|
|
|
): Promise<RepoEvent> => { |
|
|
|
): Promise<RepoEvent> => { |
|
|
|
return new Promise((r) => { |
|
|
|
return new Promise((r) => { |
|
|
|
const unsubscriber = ensureRepo(a, naddr_relays).subscribe((c) => { |
|
|
|
const unsubscriber = ensureRepo(a, naddr_relays).subscribe((c) => { |
|
|
|
@ -123,7 +123,7 @@ export const returnRepo = async ( |
|
|
|
|
|
|
|
|
|
|
|
export const ensureRepoCollection = ( |
|
|
|
export const ensureRepoCollection = ( |
|
|
|
a: string, |
|
|
|
a: string, |
|
|
|
naddr_relays: string[] | undefined = undefined, |
|
|
|
naddr_relays: string[] | undefined = undefined |
|
|
|
): Writable<RepoCollection> => { |
|
|
|
): Writable<RepoCollection> => { |
|
|
|
if (!repo_collections[a]) { |
|
|
|
if (!repo_collections[a]) { |
|
|
|
const base: RepoCollection = { |
|
|
|
const base: RepoCollection = { |
|
|
|
|