diff --git a/src/app/components/Chat.svelte b/src/app/components/Chat.svelte index f9e51a80..cecdad9f 100644 --- a/src/app/components/Chat.svelte +++ b/src/app/components/Chat.svelte @@ -35,13 +35,13 @@ } from "@welshman/app" import Danger from "@assets/icons/danger-triangle.svg?dataurl" import Icon from "@lib/components/Icon.svelte" - import Link from "@lib/components/Link.svelte" import Spinner from "@lib/components/Spinner.svelte" import PageBar from "@lib/components/PageBar.svelte" import PageContent from "@lib/components/PageContent.svelte" import Divider from "@lib/components/Divider.svelte" import Button from "@lib/components/Button.svelte" import ProfileName from "@app/components/ProfileName.svelte" + import ProfileLink from "@app/components/ProfileLink.svelte" import ProfileCircle from "@app/components/ProfileCircle.svelte" import ProfileCircles from "@app/components/ProfileCircles.svelte" import ProfileDetail from "@app/components/ProfileDetail.svelte" @@ -51,7 +51,7 @@ import ChatComposeEdit from "@app/components/ChatComposeEdit.svelte" import ChatComposeParent from "@app/components/ChatComposeParent.svelte" import ThunkToast from "@app/components/ThunkToast.svelte" - import {userSettingsValues, PLATFORM_NAME, deriveChat} from "@app/core/state" + import {userSettingsValues, deriveChat} from "@app/core/state" import {pushModal} from "@app/util/modal" import {makeDelete, prependParent} from "@app/core/commands" import {pushToast} from "@app/util/toast" @@ -289,12 +289,14 @@

- {missingRelayLists.length} messaging - {missingRelayLists.length > 1 ? "lists are" : "list is"} not configured. + Direct messages are not enabled

- In order to deliver messages, {PLATFORM_NAME} needs to know where to send them. Please make - sure everyone in this conversation has set up their messaging relays. + Ask + {#each missingRelayLists as pubkey (pubkey)} + + {/each} + to enable direct messaging by opening this conversation in their app.

@@ -339,6 +341,7 @@ {onSubmit} {onEscape} {onEditPrevious} - content={eventToEdit?.content} /> + content={eventToEdit?.content} + disabled={Boolean(missingRelayLists.length)} /> {/key} diff --git a/src/app/components/ChatCompose.svelte b/src/app/components/ChatCompose.svelte index 43f4a80f..68b62447 100644 --- a/src/app/components/ChatCompose.svelte +++ b/src/app/components/ChatCompose.svelte @@ -1,6 +1,7 @@ + + + + + Enable direct messaging? + +

Direct messaging isn't currently enabled. Would you like to turn it on?

+
+ + + + +
diff --git a/src/app/components/ChatItem.svelte b/src/app/components/ChatItem.svelte index e7087a10..dd83ce7b 100644 --- a/src/app/components/ChatItem.svelte +++ b/src/app/components/ChatItem.svelte @@ -5,11 +5,11 @@ import type {TrustedEvent} from "@welshman/util" import {pubkey, loadMessagingRelayList} from "@welshman/app" import {fade} from "@lib/transition" - import Link from "@lib/components/Link.svelte" + import Button from "@lib/components/Button.svelte" import ProfileName from "@app/components/ProfileName.svelte" import ProfileCircle from "@app/components/ProfileCircle.svelte" import ProfileCircles from "@app/components/ProfileCircles.svelte" - import {makeChatPath} from "@app/util/routes" + import {makeChatPath, goToChat} from "@app/util/routes" import {notifications} from "@app/util/notifications" interface Props { @@ -24,6 +24,7 @@ const others = uniq(remove($pubkey!, props.pubkeys)) const active = $derived($page.params.chat === props.id) const path = makeChatPath(props.pubkeys) + const openChat = () => goToChat(props.pubkeys) onMount(() => { for (const pk of others) { @@ -32,7 +33,7 @@ }) - + diff --git a/src/app/components/ChatStart.svelte b/src/app/components/ChatStart.svelte index 1cfe90d4..37c6dd15 100644 --- a/src/app/components/ChatStart.svelte +++ b/src/app/components/ChatStart.svelte @@ -2,7 +2,6 @@ import * as nip19 from "nostr-tools/nip19" import {onMount} from "svelte" import {writable} from "svelte/store" - import {goto} from "$app/navigation" import {tryCatch, uniq} from "@welshman/lib" import {fromNostrURI} from "@welshman/util" import {loadMessagingRelayList} from "@welshman/app" @@ -19,11 +18,11 @@ import ModalSubtitle from "@lib/components/ModalSubtitle.svelte" import ModalFooter from "@lib/components/ModalFooter.svelte" import ProfileMultiSelect from "@app/components/ProfileMultiSelect.svelte" - import {makeChatPath} from "@app/util/routes" + import {goToChat} from "@app/util/routes" const back = () => history.back() - const onSubmit = () => goto(makeChatPath(pubkeys)) + const onSubmit = () => goToChat(pubkeys) const addPubkey = (pubkey: string) => { pubkeys = uniq([...pubkeys, pubkey]) diff --git a/src/app/components/PrimaryNav.svelte b/src/app/components/PrimaryNav.svelte index 6fe1bc48..6968352b 100644 --- a/src/app/components/PrimaryNav.svelte +++ b/src/app/components/PrimaryNav.svelte @@ -14,7 +14,7 @@ import {userSpaceUrls, PLATFORM_RELAYS} from "@app/core/state" import {pushModal} from "@app/util/modal" import {notifications} from "@app/util/notifications" - import {goToLastChat} from "@app/util/routes" + import {goToChat} from "@app/util/routes" type Props = { children?: Snippet @@ -22,6 +22,8 @@ const {children}: Props = $props() + const chatHandler = () => goToChat() + const showSettingsMenu = () => pushModal(MenuSettings) const anySpaceNotifications = $derived($userSpaceUrls.some(p => $notifications.has(p))) @@ -48,7 +50,7 @@ @@ -76,7 +78,7 @@ diff --git a/src/app/components/ProfileDetail.svelte b/src/app/components/ProfileDetail.svelte index 0c7484ee..9580f8df 100644 --- a/src/app/components/ProfileDetail.svelte +++ b/src/app/components/ProfileDetail.svelte @@ -1,6 +1,5 @@