parent
35058ed965
commit
d5fb6c568c
|
@ -145,7 +145,8 @@
|
||||||
autoFocus: false,
|
autoFocus: false,
|
||||||
hideBottomBorder: false,
|
hideBottomBorder: false,
|
||||||
hidden: false,
|
hidden: false,
|
||||||
dialogId: undefined
|
dialogId: undefined,
|
||||||
|
aboutToPostStatus: false
|
||||||
}),
|
}),
|
||||||
store: () => store,
|
store: () => store,
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -184,12 +185,22 @@
|
||||||
slide
|
slide
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
doPostStatus () {
|
async doPostStatus () {
|
||||||
|
const { aboutToPostStatus } = this.get()
|
||||||
|
const { postingStatus } = this.store.get()
|
||||||
|
if (aboutToPostStatus || postingStatus) { // do nothing if the user rapidly taps the Ctrl-Enter key
|
||||||
|
console.log('ignored post command', { aboutToPostStatus, postingStatus })
|
||||||
|
return
|
||||||
|
}
|
||||||
// The reason we add a scheduleIdleTask delay here is because we also use scheduleIdleTask
|
// The reason we add a scheduleIdleTask delay here is because we also use scheduleIdleTask
|
||||||
// in ComposeInput.html to debounce the input events. If the user is very fast at typing
|
// in ComposeInput.html to debounce the input events. If the user is very fast at typing
|
||||||
// at their keyboard and quickly presses Ctrl+Enter or the "Toot" button then there could
|
// at their keyboard and quickly presses Ctrl+Enter or the "Toot" button then there could
|
||||||
// be a race condition where not all of their status is posted.
|
// be a race condition where not all of their status is posted.
|
||||||
scheduleIdleTask(() => this.doPostStatusAfterDelay())
|
this.set({ aboutToPostStatus: true })
|
||||||
|
scheduleIdleTask(() => {
|
||||||
|
this.set({ aboutToPostStatus: false })
|
||||||
|
this.doPostStatusAfterDelay()
|
||||||
|
})
|
||||||
},
|
},
|
||||||
doPostStatusAfterDelay () {
|
doPostStatusAfterDelay () {
|
||||||
const {
|
const {
|
||||||
|
@ -228,8 +239,7 @@
|
||||||
options: poll.options
|
options: poll.options
|
||||||
}
|
}
|
||||||
|
|
||||||
/* no await */
|
/* no await */ postStatus(realm, text, inReplyTo, mediaIds,
|
||||||
postStatus(realm, text, inReplyTo, mediaIds,
|
|
||||||
sensitive, contentWarning, postPrivacyKey,
|
sensitive, contentWarning, postPrivacyKey,
|
||||||
mediaDescriptions, inReplyToUuid, pollToPost,
|
mediaDescriptions, inReplyToUuid, pollToPost,
|
||||||
mediaFocalPoints)
|
mediaFocalPoints)
|
||||||
|
|
Loading…
Reference in New Issue