Switch to implicit state
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user