Disable drafts for chats
This commit is contained in:
parent
f41f7c77d9
commit
91500ee4b0
|
@ -76,6 +76,7 @@
|
||||||
:disable-sensitivity-checkbox="true"
|
:disable-sensitivity-checkbox="true"
|
||||||
:disable-submit="errorLoadingChat || !currentChat"
|
:disable-submit="errorLoadingChat || !currentChat"
|
||||||
:disable-preview="true"
|
:disable-preview="true"
|
||||||
|
:disable-draft="true"
|
||||||
:optimistic-posting="true"
|
:optimistic-posting="true"
|
||||||
:post-handler="sendMessage"
|
:post-handler="sendMessage"
|
||||||
:submit-on-enter="!mobileLayout"
|
:submit-on-enter="!mobileLayout"
|
||||||
|
|
|
@ -93,6 +93,7 @@ const PostStatusForm = {
|
||||||
'disableSensitivityCheckbox',
|
'disableSensitivityCheckbox',
|
||||||
'disableSubmit',
|
'disableSubmit',
|
||||||
'disablePreview',
|
'disablePreview',
|
||||||
|
'disableDraft',
|
||||||
'placeholder',
|
'placeholder',
|
||||||
'maxHeight',
|
'maxHeight',
|
||||||
'postHandler',
|
'postHandler',
|
||||||
|
@ -146,7 +147,7 @@ const PostStatusForm = {
|
||||||
const [statusType, refId] = typeAndRefId({ replyTo: this.replyTo, profileMention: this.profileMention, statusId: this.statusId })
|
const [statusType, refId] = typeAndRefId({ replyTo: this.replyTo, profileMention: this.profileMention, statusId: this.statusId })
|
||||||
|
|
||||||
// If we are starting a new post, do not associate it with old drafts
|
// If we are starting a new post, do not associate it with old drafts
|
||||||
let statusParams = (this.draftId || statusType !== 'new') ? this.getDraft(statusType, refId) : null
|
let statusParams = !this.disableDraft && (this.draftId || statusType !== 'new') ? this.getDraft(statusType, refId) : null
|
||||||
|
|
||||||
if (!statusParams) {
|
if (!statusParams) {
|
||||||
if (statusType === 'reply' || statusType === 'mention') {
|
if (statusType === 'reply' || statusType === 'mention') {
|
||||||
|
@ -725,7 +726,8 @@ const PostStatusForm = {
|
||||||
return propsToNative(props)
|
return propsToNative(props)
|
||||||
},
|
},
|
||||||
saveDraft () {
|
saveDraft () {
|
||||||
if (!this.saveInhibited &&
|
if (!this.disableDraft &&
|
||||||
|
!this.saveInhibited &&
|
||||||
(this.newStatus.status ||
|
(this.newStatus.status ||
|
||||||
this.newStatus.files?.length ||
|
this.newStatus.files?.length ||
|
||||||
this.newStatus.hasPoll
|
this.newStatus.hasPoll
|
||||||
|
|
|
@ -298,13 +298,13 @@
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<span
|
<span
|
||||||
v-if="shouldAutoSaveDraft"
|
v-if="!disableDraft && shouldAutoSaveDraft"
|
||||||
class="auto-save-status"
|
class="auto-save-status"
|
||||||
>
|
>
|
||||||
{{ autoSaveState }}
|
{{ autoSaveState }}
|
||||||
</span>
|
</span>
|
||||||
<button
|
<button
|
||||||
v-else
|
v-else-if="!disableDraft"
|
||||||
class="btn button-default"
|
class="btn button-default"
|
||||||
@click="saveDraft"
|
@click="saveDraft"
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in a new issue