mirror of
https://github.com/coracle-social/coracle.git
synced 2024-09-19 11:43:35 +00:00
when browsing a relay, the publish button is prefilled to publish just on that.
This commit is contained in:
parent
faaac70c1a
commit
ba6c630fab
@ -8,10 +8,13 @@
|
||||
const {canPublish} = user
|
||||
|
||||
const createNote = () => {
|
||||
const matches = $location.pathname.match(/people\/(npub1[0-9a-z]+)/)
|
||||
const pubkey = matches ? nip19.decode(matches[1]).data : null
|
||||
const pubkeyMatch = $location.pathname.match(/people\/(npub1[0-9a-z]+)/)
|
||||
const pubkey = pubkeyMatch ? nip19.decode(pubkeyMatch[1]).data : null
|
||||
const relayMatch = $location.pathname.match(/relays\/(.+)/)
|
||||
const relay = relayMatch ? relayMatch[1] : null
|
||||
const relays = relay ? [relay] : null
|
||||
|
||||
modal.push({type: "note/create", pubkey})
|
||||
modal.push({type: "note/create", pubkey, relays})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
@ -27,7 +27,7 @@
|
||||
<NoteDetail {...m} invertColors />
|
||||
{/key}
|
||||
{:else if m.type === "note/create"}
|
||||
<NoteCreate pubkey={m.pubkey} nevent={m.nevent} />
|
||||
<NoteCreate pubkey={m.pubkey} nevent={m.nevent} writeTo={m.relays} />
|
||||
{:else if m.type === "note/zap"}
|
||||
<NoteZap note={m.note} />
|
||||
{:else if m.type === "relay/add"}
|
||||
|
@ -25,12 +25,13 @@
|
||||
|
||||
export let pubkey = null
|
||||
export let nevent = null
|
||||
export let writeTo = null
|
||||
|
||||
let q = ""
|
||||
let image = null
|
||||
let compose = null
|
||||
let showSettings = false
|
||||
let relays = writable(getUserWriteRelays())
|
||||
let relays = writable(writeTo ? writeTo.map(url => ({url, score: 1})) : getUserWriteRelays())
|
||||
|
||||
const onSubmit = async () => {
|
||||
let {content, mentions, topics} = compose.parse()
|
||||
|
Loading…
Reference in New Issue
Block a user