Switch to implicit state

This commit is contained in:
Jon Staab
2024-10-24 14:02:43 -07:00
parent cce5761235
commit ceb7f3340d
4 changed files with 41 additions and 12 deletions
+6 -1
View File
@@ -2,12 +2,14 @@
import {nip19} from "nostr-tools"
import {goto} from "$app/navigation"
import {ctx} from "@welshman/lib"
import {toNostrURI} from "@welshman/util"
import Icon from "@lib/components/Icon.svelte"
import Button from "@lib/components/Button.svelte"
import ModalHeader from "@lib/components/ModalHeader.svelte"
import ModalFooter from "@lib/components/ModalFooter.svelte"
import {roomsByUrl} from "@app/state"
import {makeRoomPath} from "@app/routes"
import {setKey} from "@app/implicit"
export let url
export let event
@@ -17,7 +19,10 @@
const back = () => history.back()
const onSubmit = () => goto(makeRoomPath(url, selection) + "?content=nostr:" + nevent)
const onSubmit = () => {
setKey('content', toNostrURI(nevent))
goto(makeRoomPath(url, selection), {replaceState: true})
}
const toggleRoom = (room: string) => {
selection = room === selection ? "" : room