Move nip29 check

This commit is contained in:
Jon Staab
2024-12-12 14:49:30 -08:00
parent 9d6531c0d5
commit 9f3bfd5ac0
5 changed files with 12 additions and 9 deletions
+2 -1
View File
@@ -9,6 +9,7 @@
import Icon from "@lib/components/Icon.svelte"
import ModalHeader from "@lib/components/ModalHeader.svelte"
import ModalFooter from "@lib/components/ModalFooter.svelte"
import {hasNip29} from "@app/state"
import {addRoomMembership, nip29, getThunkError} from "@app/commands"
import {makeSpacePath} from "@app/routes"
import {pushToast} from "@app/toast"
@@ -21,7 +22,7 @@
const back = () => history.back()
const tryCreate = async () => {
if (nip29.isSupported($relay)) {
if (hasNip29($relay)) {
const createMessage = await getThunkError(nip29.createRoom(url, room))
if (createMessage && !createMessage.match(/^duplicate:|already a member/)) {
+2 -2
View File
@@ -32,9 +32,9 @@
// Delay updating isPending so users can see that the message is sent
$: {
isPending = isPending || ps.some(s => s.status == Pending)
isPending = isPending || ps.some(s => s.status === Pending)
if (!ps.some(s => s.status == Pending)) {
if (!ps.some(s => s.status === Pending)) {
setTimeout(() => {
isPending = false
}, 2000)