Fix reactions on mobile
This commit is contained in:
parent
993bf8d2e6
commit
c40e8ce1a7
2 changed files with 6 additions and 4 deletions
|
|
@ -1,5 +1,6 @@
|
|||
<script lang="ts">
|
||||
import type {NativeEmoji} from "emoji-picker-element/shared"
|
||||
import type {TrustedEvent} from "@welshman/util"
|
||||
import {pubkey} from "@welshman/app"
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
|
|
@ -11,10 +12,10 @@
|
|||
|
||||
const {url, event, reply} = $props()
|
||||
|
||||
const onEmoji = (emoji: NativeEmoji) => {
|
||||
const onEmoji = ((event: TrustedEvent, url: string, emoji: NativeEmoji) => {
|
||||
history.back()
|
||||
publishReaction({event, relays: [url], content: emoji.unicode})
|
||||
}
|
||||
}).bind(undefined, $state.snapshot(event), url)
|
||||
|
||||
const showEmojiPicker = () => pushModal(EmojiPicker, {onClick: onEmoji}, {replaceState: true})
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
<script lang="ts">
|
||||
import type {NativeEmoji} from "emoji-picker-element/shared"
|
||||
import type {TrustedEvent} from "@welshman/util"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
import EmojiPicker from "@lib/components/EmojiPicker.svelte"
|
||||
|
|
@ -10,10 +11,10 @@
|
|||
|
||||
const {event, pubkeys} = $props()
|
||||
|
||||
const onEmoji = (emoji: NativeEmoji) => {
|
||||
const onEmoji = ((event: TrustedEvent, emoji: NativeEmoji) => {
|
||||
history.back()
|
||||
sendWrapped({template: makeReaction({event, content: emoji.unicode}), pubkeys})
|
||||
}
|
||||
}).bind(undefined, $state.snapshot(event))
|
||||
|
||||
const showEmojiPicker = () => pushModal(EmojiPicker, {onClick: onEmoji}, {replaceState: true})
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue