mirror of
https://github.com/coracle-social/coracle.git
synced 2024-09-18 19:23:40 +00:00
Pre-calculate timestamp display for perf
This commit is contained in:
parent
7d5f132e1f
commit
35c1b4b2ed
@ -1,6 +1,5 @@
|
|||||||
# Current
|
# Current
|
||||||
|
|
||||||
- [ ] formatTimestamp is expensive, cache it by assigning to events
|
|
||||||
- [ ] Fix hover on notes in modal
|
- [ ] Fix hover on notes in modal
|
||||||
- [ ] Show loading/success on zap invoice screen
|
- [ ] Show loading/success on zap invoice screen
|
||||||
- [ ] Fix iOS/safari/firefox
|
- [ ] Fix iOS/safari/firefox
|
||||||
@ -36,6 +35,8 @@
|
|||||||
|
|
||||||
# More
|
# More
|
||||||
|
|
||||||
|
- [ ] Performance
|
||||||
|
- same deal as with formatTimestamp, don't use functions inline since svelte can't cache them
|
||||||
- [ ] Image Uploads
|
- [ ] Image Uploads
|
||||||
- [ ] Add LN invoices
|
- [ ] Add LN invoices
|
||||||
- [ ] Contact other client authors, self-hostable, or just use my instance
|
- [ ] Contact other client authors, self-hostable, or just use my instance
|
||||||
|
@ -55,6 +55,7 @@
|
|||||||
let showRelays = false
|
let showRelays = false
|
||||||
|
|
||||||
const {profile} = user
|
const {profile} = user
|
||||||
|
const timestamp = formatTimestamp(note.created_at)
|
||||||
const borderColor = invertColors ? "medium" : "dark"
|
const borderColor = invertColors ? "medium" : "dark"
|
||||||
const links = extractUrls(note.content)
|
const links = extractUrls(note.content)
|
||||||
const showEntire = anchorId === note.id
|
const showEntire = anchorId === note.id
|
||||||
@ -358,7 +359,7 @@
|
|||||||
href={"/" + nip19.neventEncode({id: note.id, relays: [note.seen_on]})}
|
href={"/" + nip19.neventEncode({id: note.id, relays: [note.seen_on]})}
|
||||||
class="text-sm text-light"
|
class="text-sm text-light"
|
||||||
type="unstyled">
|
type="unstyled">
|
||||||
{formatTimestamp(note.created_at)}
|
{timestamp}
|
||||||
</Anchor>
|
</Anchor>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-col gap-2">
|
<div class="flex flex-col gap-2">
|
||||||
|
Loading…
Reference in New Issue
Block a user