app

Local-first trade for farms and co-ops
git clone https://radroots.dev/git/app.git
Log | Files | Refs | README | LICENSE

inbox-profile.ts (775B)


      1 import {
      2   inboxPreferenceSnapshot,
      3   type InboxPreference
      4 } from '../nostr/inbox-preferences.ts';
      5 
      6 // Detached public preference presentation only. No missing/ready conclusion,
      7 // guessed destination, connection, provider, persistence or setup effect.
      8 export function inboxProfileSnapshot(preference: InboxPreference):
      9   | Readonly<{
     10       author: string;
     11       id: string;
     12       createdAt: number;
     13       status: 'compatible' | 'unsupported';
     14       advertised: string[];
     15     }>
     16   | undefined {
     17   const saved = inboxPreferenceSnapshot(preference);
     18   return (
     19     saved && {
     20       author: saved.author,
     21       id: saved.id,
     22       createdAt: saved.createdAt,
     23       status: saved.status === 'supported' ? 'compatible' : 'unsupported',
     24       advertised: saved.relays
     25     }
     26   );
     27 }