Initial commit: Nosterm client (terminal-style Nostr chat SPA)
ci / build (push) Successful in 1m3s
ci / image (push) Successful in 41s

This commit is contained in:
Robert Goodall
2026-07-24 13:47:53 -04:00
commit cd2b900639
147 changed files with 16504 additions and 0 deletions
@@ -0,0 +1,18 @@
import { getDb, type RelayRecord } from '../database';
import { normalizeRelayUrl } from '$lib/utils/relay-url';
/** storage for the relays the user has added. */
export const relayRepository = {
async list(): Promise<RelayRecord[]> {
return getDb().relays.orderBy('addedAt').toArray();
},
async add(url: string): Promise<void> {
const normalized = normalizeRelayUrl(url);
await getDb().relays.put({ url: normalized, addedAt: Date.now() });
},
async remove(url: string): Promise<void> {
await getDb().relays.delete(normalizeRelayUrl(url));
}
};