forked from coracle/flotilla
Rename reply to comment
This commit is contained in:
@@ -7,19 +7,19 @@
|
||||
import {deriveEvents} from "@welshman/store"
|
||||
import ChannelMessage from "@app/components/ChannelMessage.svelte"
|
||||
import ChannelCompose from "@app/components/ChannelCompose.svelte"
|
||||
import {tagRoom, REPLY} from "@app/state"
|
||||
import {publishReply} from "@app/commands"
|
||||
import {tagRoom, COMMENT} from "@app/state"
|
||||
import {publishComment} from "@app/commands"
|
||||
|
||||
export let url, room, event: TrustedEvent
|
||||
|
||||
const thunks = writable({} as Record<string, Thunk>)
|
||||
|
||||
const replies = deriveEvents(repository, {
|
||||
filters: [{kinds: [REPLY], "#E": [event.id]}],
|
||||
filters: [{kinds: [COMMENT], "#E": [event.id]}],
|
||||
})
|
||||
|
||||
const onSubmit = ({content, tags}: EventContent) => {
|
||||
const thunk = publishReply({
|
||||
const thunk = publishComment({
|
||||
event,
|
||||
content,
|
||||
tags: append(tagRoom(room, url), tags),
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import Link from "@lib/components/Link.svelte"
|
||||
import Spinner from "@lib/components/Spinner.svelte"
|
||||
import NoteCard from "@app/components/NoteCard.svelte"
|
||||
import {deriveEvent, entityLink, userMembership, getMembershipUrls, REPLY} from "@app/state"
|
||||
import {deriveEvent, entityLink, userMembership, getMembershipUrls, COMMENT} from "@app/state"
|
||||
import {makeThreadPath} from "@app/routes"
|
||||
|
||||
export let value
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
// If we found this event on a relay that the user is a member of, redirect internally
|
||||
$: url = getMembershipUrls($userMembership).find(url => $trackerStore.hasRelay($event?.id, url))
|
||||
$: root = $event?.kind === REPLY ? $event.tags.find(nthEq(0, "E"))?.[1] : $event?.id
|
||||
$: root = $event?.kind === COMMENT ? $event.tags.find(nthEq(0, "E"))?.[1] : $event?.id
|
||||
$: href = url && root ? makeThreadPath(url, root) : entityLink(entity)
|
||||
</script>
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
import {deriveEvents} from "@welshman/store"
|
||||
import {repository} from "@welshman/app"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import {REPLY} from "@app/state"
|
||||
import {COMMENT} from "@app/state"
|
||||
|
||||
export let event
|
||||
|
||||
const replies = deriveEvents(repository, {filters: [{kinds: [REPLY], "#E": [event.id]}]})
|
||||
const replies = deriveEvents(repository, {filters: [{kinds: [COMMENT], "#E": [event.id]}]})
|
||||
</script>
|
||||
|
||||
{#if $replies.length > 0}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
import ReactionSummary from "@app/components/ReactionSummary.svelte"
|
||||
import ThreadMenu from "@app/components/ThreadMenu.svelte"
|
||||
import {publishDelete, publishReaction} from "@app/commands"
|
||||
import {REPLY} from "@app/state"
|
||||
import {COMMENT} from "@app/state"
|
||||
|
||||
export let url
|
||||
export let event
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
const deleted = deriveIsDeleted(repository, event)
|
||||
|
||||
const replies = deriveEvents(repository, {filters: [{kinds: [REPLY], "#E": [event.id]}]})
|
||||
const replies = deriveEvents(repository, {filters: [{kinds: [COMMENT], "#E": [event.id]}]})
|
||||
|
||||
const showPopover = () => popover.show()
|
||||
|
||||
|
||||
@@ -7,13 +7,13 @@
|
||||
import ThreadShare from "@app/components/ThreadShare.svelte"
|
||||
import {publishDelete} from "@app/commands"
|
||||
import {pushModal} from "@app/modal"
|
||||
import {REPLY} from "@app/state"
|
||||
import {COMMENT} from "@app/state"
|
||||
|
||||
export let url
|
||||
export let event
|
||||
export let onClick
|
||||
|
||||
const isRoot = event.kind !== REPLY
|
||||
const isRoot = event.kind !== COMMENT
|
||||
|
||||
const showInfo = () => {
|
||||
onClick()
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
import ModalFooter from "@lib/components/ModalFooter.svelte"
|
||||
import {getPubkeyHints, publishReply} from "@app/commands"
|
||||
import {getPubkeyHints, publishComment} from "@app/commands"
|
||||
import {getEditorOptions, addFile, uploadFiles, getEditorTags} from "@lib/editor"
|
||||
import {pushToast} from '@app/toast'
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
})
|
||||
}
|
||||
|
||||
onSubmit(publishReply({event, content, tags, relays: [url]}))
|
||||
onSubmit(publishComment({event, content, tags, relays: [url]}))
|
||||
}
|
||||
|
||||
let editor: Readable<Editor>
|
||||
|
||||
Reference in New Issue
Block a user