tentative fix for caching issues (#3), plus ux cleanup
This commit is contained in:
parent
b5bb27e1b2
commit
4fdf8b57c9
3 changed files with 52 additions and 56 deletions
|
@ -6,6 +6,7 @@
|
||||||
import Dialog from './Dialog.svelte';
|
import Dialog from './Dialog.svelte';
|
||||||
import Select from './Select.svelte';
|
import Select from './Select.svelte';
|
||||||
import type { Letter } from '$lib/letter';
|
import type { Letter } from '$lib/letter';
|
||||||
|
import { slide } from 'svelte/transition';
|
||||||
|
|
||||||
let {
|
let {
|
||||||
letters,
|
letters,
|
||||||
|
@ -112,36 +113,38 @@
|
||||||
{#snippet letterGroup(letters)}
|
{#snippet letterGroup(letters)}
|
||||||
<div class="letter-group">
|
<div class="letter-group">
|
||||||
{#each letters as letter}
|
{#each letters as letter}
|
||||||
<a class="letter-item" href="/letters/{letter.id}">
|
{#key letter.id}
|
||||||
<div class="subject-line">
|
<a in:slide out:slide class="letter-item" href="/letters/{letter.id}">
|
||||||
<div class="letter-subject">
|
<div class="subject-line">
|
||||||
<Icon icon="mdi:letter-outline" /> {letter.subject}
|
<div class="letter-subject">
|
||||||
</div>
|
<Icon icon="mdi:letter-outline" /> {letter.subject}
|
||||||
{#if letter.stamps}
|
|
||||||
<div class="stamps-count">
|
|
||||||
<Icon icon="emojione-v1:stamped-envelope" />
|
|
||||||
{letter.stamps} sats
|
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{#if letter.stamps}
|
||||||
</div>
|
<div class="stamps-count">
|
||||||
<div class="letter-from">
|
<Icon icon="emojione-v1:stamped-envelope" />
|
||||||
{#if folder.id === 'sent'}
|
{letter.stamps} sats
|
||||||
{#each letter.recipients as recipient}
|
</div>
|
||||||
<NostrIdentifier user={recipient.npub} />
|
{/if}
|
||||||
{/each}
|
</div>
|
||||||
{:else}
|
<div class="letter-from">
|
||||||
<NostrIdentifier user={letter.from.npub} emailAddress={letter.emailAddress} />
|
{#if folder.id === 'sent'}
|
||||||
{/if}
|
{#each letter.recipients as recipient}
|
||||||
</div>
|
<NostrIdentifier user={recipient.npub} />
|
||||||
<div class="letter-meta">
|
{/each}
|
||||||
<Icon icon="mdi:calendar" />
|
{:else}
|
||||||
{getReadableDate(letter.date)}
|
<NostrIdentifier user={letter.from.npub} emailAddress={letter.emailAddress} />
|
||||||
|
{/if}
|
||||||
<Icon icon="mdi:clock-outline" />
|
</div>
|
||||||
{getReadableTime(letter.date)}
|
<div class="letter-meta">
|
||||||
</div>
|
<Icon icon="mdi:calendar" />
|
||||||
<div class="letter-preview">{letter.preview}</div>
|
{getReadableDate(letter.date)}
|
||||||
</a>
|
|
||||||
|
<Icon icon="mdi:clock-outline" />
|
||||||
|
{getReadableTime(letter.date)}
|
||||||
|
</div>
|
||||||
|
<div class="letter-preview">{letter.preview}</div>
|
||||||
|
</a>
|
||||||
|
{/key}
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
@ -161,25 +164,27 @@
|
||||||
<div class="letter-list">
|
<div class="letter-list">
|
||||||
<div class="letter-group">
|
<div class="letter-group">
|
||||||
{#each letters as letter}
|
{#each letters as letter}
|
||||||
<div class="letter-item"
|
{#key letter.id}
|
||||||
onclick={() => clickedLetter(letter)}
|
<div class="letter-item"
|
||||||
class:selected={selectedLetters.includes(letter.id)}
|
onclick={() => clickedLetter(letter)}
|
||||||
>
|
class:selected={selectedLetters.includes(letter.id)}
|
||||||
<div class="subject-line">
|
>
|
||||||
<div class="letter-subject">
|
<div class="subject-line">
|
||||||
<Icon icon="mdi:letter-outline" /> {letter.subject}
|
<div class="letter-subject">
|
||||||
</div>
|
<Icon icon="mdi:letter-outline" /> {letter.subject}
|
||||||
{#if letter.stamps}
|
|
||||||
<div class="stamps-count">
|
|
||||||
<Icon icon="emojione-v1:stamped-envelope" />
|
|
||||||
{letter.stamps} sats
|
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{#if letter.stamps}
|
||||||
|
<div class="stamps-count">
|
||||||
|
<Icon icon="emojione-v1:stamped-envelope" />
|
||||||
|
{letter.stamps} sats
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
</div>
|
||||||
|
<div class="letter-from">
|
||||||
|
<NostrIdentifier user={letter.from.npub} emailAddress={letter.emailAddress} />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="letter-from">
|
{/key}
|
||||||
<NostrIdentifier user={letter.from.npub} emailAddress={letter.emailAddress} />
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -111,7 +111,7 @@
|
||||||
<Icon icon="ph:user" />
|
<Icon icon="ph:user" />
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
{#if npub !== displayString}
|
{#if npub !== displayString && !emailAddress}
|
||||||
<Tooltip position="bottom" content={npub}>
|
<Tooltip position="bottom" content={npub}>
|
||||||
<span class="user-text">{displayString}</span>
|
<span class="user-text">{displayString}</span>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|
|
@ -5,15 +5,6 @@ import { TokenInfoWithMailSubscriptionDuration } from '@arx/utils';
|
||||||
function parseTextPlainContent(mimeMessage: string) {
|
function parseTextPlainContent(mimeMessage: string) {
|
||||||
const boundary = mimeMessage.split('\n')[0];
|
const boundary = mimeMessage.split('\n')[0];
|
||||||
|
|
||||||
// --7408fffb1a494ae39c2dde2c60878849
|
|
||||||
// Content-Type: text/plain
|
|
||||||
// Content-Transfer-Encoding: 7bit
|
|
||||||
//
|
|
||||||
// test
|
|
||||||
// --7408fffb1a494ae39c2dde2c60878849
|
|
||||||
// Content-Type: text/html
|
|
||||||
// Content-Transfer-Encoding: 7bit
|
|
||||||
|
|
||||||
const boundaries = mimeMessage.split(boundary + '\n');
|
const boundaries = mimeMessage.split(boundary + '\n');
|
||||||
boundaries.shift();
|
boundaries.shift();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue