diff options
| author | Adrien Hopkins <[email protected]> | 2025-10-01 11:41:55 -0500 |
|---|---|---|
| committer | Adrien Hopkins <[email protected]> | 2025-10-01 11:41:55 -0500 |
| commit | 8eaf72778a8f8f84f9499a68cd4a5e798135c0f4 (patch) | |
| tree | 8ce3e93917d3e4710ea6e85ad1a4eb40efef0e31 /src | |
| parent | 878f12ec5fb2b301cd1542b6bdf512e0ad4df39b (diff) | |
| download | coinos-ui-8eaf72778a8f8f84f9499a68cd4a5e798135c0f4.tar.gz coinos-ui-8eaf72778a8f8f84f9499a68cd4a5e798135c0f4.zip | |
Improve displayed message format
Diffstat (limited to 'src')
| -rw-r--r-- | src/routes/(app)/dm/[recipient]/+page.svelte | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/routes/(app)/dm/[recipient]/+page.svelte b/src/routes/(app)/dm/[recipient]/+page.svelte index d450849a..0c349f45 100644 --- a/src/routes/(app)/dm/[recipient]/+page.svelte +++ b/src/routes/(app)/dm/[recipient]/+page.svelte @@ -44,6 +44,16 @@ return toolsnip17.unwrapEvent(event, sk); } } + + const dmName = (pubkey: string): string => { + if (pubkey === user.pubkey) { + return user.username; + } else if (pubkey === recipient.pubkey) { + return recipient.username; + } else { + return pubkey; + } + } </script> <div class="container"> @@ -61,11 +71,11 @@ >Direct Messages</h1> <p>You are sending nostr messages to {recipient.username}.</p> - <p>Received Messages:</p> + <p>Past Messages:</p> <ul> {#each events as evt} {#if evt.pubkey === recipient.pubkey || evt.pubkey === user.pubkey} - <li>{new Date(evt.created_at * 1000)}: "{evt.content}"</li> + <li>[{new Date(evt.created_at * 1000).toISOString()}] {dmName(evt.pubkey)}: "{evt.content}"</li> {/if} {/each} </ul> |
