From 8b3de914085c4b48a51461564d77678a81efaa35 Mon Sep 17 00:00:00 2001 From: Jonathan Staab Date: Thu, 29 Jun 2023 08:45:04 -0700 Subject: [PATCH] Fix show more button --- ROADMAP.md | 2 ++ src/app/shared/NoteContent.svelte | 4 ++-- src/app/shared/NoteContentKind1.svelte | 6 ++++-- src/app/views/Notification.svelte | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ROADMAP.md b/ROADMAP.md index 6bdcdf64..ed9e2661 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -1,5 +1,7 @@ # Current +- [ ] nsec bunker support +- [ ] Add relayset support with kind 30022 - [ ] White-labeled - [ ] Add invite code registration for relay - [ ] Add endpoint to nostream that updates whitelist diff --git a/src/app/shared/NoteContent.svelte b/src/app/shared/NoteContent.svelte index e3562bba..ae811fa2 100644 --- a/src/app/shared/NoteContent.svelte +++ b/src/app/shared/NoteContent.svelte @@ -11,7 +11,7 @@ export let anchorId = null export let maxLength = 700 export let showEntire = false - export let hideShowMore = true + export let expandable = true export let showMedia = user.getSetting("showMedia") @@ -26,7 +26,7 @@ {:else if note.kind === 30023} {:else} - +
diff --git a/src/app/shared/NoteContentKind1.svelte b/src/app/shared/NoteContentKind1.svelte index 88bfc1fb..1ee3b8e5 100644 --- a/src/app/shared/NoteContentKind1.svelte +++ b/src/app/shared/NoteContentKind1.svelte @@ -25,13 +25,15 @@ export let anchorId = false export let showEntire = false export let showMedia = false - export let hideShowMore = false + export let expandable = true const fullContent = parseContent(note) const shortContent = truncateContent(fullContent, {maxLength, showEntire, showMedia}) const links = getLinks(shortContent) const extraLinks = without(links, getLinks(fullContent)) + console.log(fullContent, shortContent) + export const isNewline = i => !shortContent[i] || shortContent[i].type === NEWLINE || @@ -46,7 +48,7 @@ {#if type === NEWLINE} {:else if type === ELLIPSIS} - {#if !hideShowMore} + {#if expandable} {/if} {:else if type === TOPIC} diff --git a/src/app/views/Notification.svelte b/src/app/views/Notification.svelte index 961fead6..e816a87a 100644 --- a/src/app/views/Notification.svelte +++ b/src/app/views/Notification.svelte @@ -75,7 +75,7 @@
- +