Stop trying to use editor to view notes

This commit is contained in:
Jon Staab
2024-09-24 11:03:19 -07:00
parent 256a70d6fb
commit 148208f072
8 changed files with 12 additions and 67 deletions
+1 -15
View File
@@ -1,25 +1,13 @@
<script lang="ts">
import {onMount} from "svelte"
import type {Readable} from "svelte/store"
import {createEditor, type Editor, EditorContent} from "svelte-tiptap"
import {displayPubkey} from "@welshman/util"
import {deriveProfile, deriveProfileDisplay, formatTimestamp} from "@welshman/app"
import Avatar from "@lib/components/Avatar.svelte"
import {getEditorOptions} from "@lib/editor"
export let root
export let replies
const profile = deriveProfile(root.pubkey)
const profileDisplay = deriveProfileDisplay(root.pubkey)
let editor: Readable<Editor>
onMount(() => {
editor = createEditor(getEditorOptions({}))
setTimeout(() => $editor.commands.insertContent(root.content, {applyPasteRules: true}), 100)
})
</script>
<div>
@@ -36,9 +24,7 @@
</div>
<span class="text-sm opacity-75">{formatTimestamp(root.created_at)}</span>
</div>
<div class="ml-12">
<EditorContent editor={$editor} />
</div>
<div class="ml-12"></div>
</div>
{#if replies.length > 0}
Show {replies.length} {replies.length === 1 ? "reply" : "replies"}