feat: add shortcut key support for posting
This commit is contained in:
parent
8beb2430b2
commit
bf7bb286af
2 changed files with 16 additions and 8 deletions
|
|
@ -38,13 +38,10 @@ export default function PostContent({
|
|||
const [mentions, setMentions] = useState<string[]>([])
|
||||
const canPost = !!text && !posting && !uploadingFiles
|
||||
|
||||
const post = async (e: React.MouseEvent) => {
|
||||
e.stopPropagation()
|
||||
const post = async (e?: React.MouseEvent) => {
|
||||
e?.stopPropagation()
|
||||
checkLogin(async () => {
|
||||
if (!canPost) {
|
||||
close()
|
||||
return
|
||||
}
|
||||
if (!canPost) return
|
||||
|
||||
setPosting(true)
|
||||
try {
|
||||
|
|
@ -105,6 +102,7 @@ export default function PostContent({
|
|||
setText={setText}
|
||||
defaultContent={defaultContent}
|
||||
parentEvent={parentEvent}
|
||||
onSubmit={() => post()}
|
||||
/>
|
||||
<SendOnlyToSwitch
|
||||
parentEvent={parentEvent}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue