forked from Mirrors/elk
fix: prevent click event when publish button is disabled (#1481)
This commit is contained in:
parent
ca65f7379e
commit
8c76dad3c0
1 changed files with 2 additions and 0 deletions
|
@ -29,6 +29,8 @@ export const usePublish = (options: {
|
||||||
}, { deep: true })
|
}, { deep: true })
|
||||||
|
|
||||||
async function publishDraft() {
|
async function publishDraft() {
|
||||||
|
if (isPublishDisabled)
|
||||||
|
return
|
||||||
let content = htmlToText(draft.params.status || '')
|
let content = htmlToText(draft.params.status || '')
|
||||||
if (draft.mentions?.length)
|
if (draft.mentions?.length)
|
||||||
content = `${draft.mentions.map(i => `@${i}`).join(' ')} ${content}`
|
content = `${draft.mentions.map(i => `@${i}`).join(' ')} ${content}`
|
||||||
|
|
Loading…
Reference in a new issue