fix: Add a check for 24 hour window before sending a message (#1084)
Co-authored-by: Sojan Jose <sojan@pepalo.com>
This commit is contained in:
parent
12ee7e5d82
commit
0f2d3418f9
26 changed files with 292 additions and 9 deletions
|
@ -108,7 +108,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
message: '',
|
||||
isPrivate: false,
|
||||
isPrivateTabActive: false,
|
||||
isFocused: false,
|
||||
showEmojiPicker: false,
|
||||
showCannedResponsesList: false,
|
||||
|
@ -117,6 +117,12 @@ export default {
|
|||
},
|
||||
computed: {
|
||||
...mapGetters({ currentChat: 'getSelectedChat' }),
|
||||
isPrivate() {
|
||||
if (this.currentChat.can_reply) {
|
||||
return this.isPrivateTabActive;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
inboxId() {
|
||||
return this.currentChat.inbox_id;
|
||||
},
|
||||
|
@ -214,6 +220,13 @@ export default {
|
|||
},
|
||||
},
|
||||
watch: {
|
||||
currentChat(conversation) {
|
||||
if (conversation.can_reply) {
|
||||
this.isPrivateTabActive = false;
|
||||
} else {
|
||||
this.isPrivateTabActive = true;
|
||||
}
|
||||
},
|
||||
message(updatedMessage) {
|
||||
if (this.isPrivate) {
|
||||
return;
|
||||
|
@ -278,11 +291,11 @@ export default {
|
|||
}, 100);
|
||||
},
|
||||
setPrivateReplyMode() {
|
||||
this.isPrivate = true;
|
||||
this.isPrivateTabActive = true;
|
||||
this.$refs.messageInput.focus();
|
||||
},
|
||||
setReplyMode() {
|
||||
this.isPrivate = false;
|
||||
this.isPrivateTabActive = false;
|
||||
this.$refs.messageInput.focus();
|
||||
},
|
||||
emojiOnClick(emoji) {
|
||||
|
@ -327,7 +340,10 @@ export default {
|
|||
}
|
||||
this.isUploading = true;
|
||||
this.$store
|
||||
.dispatch('sendAttachment', [this.currentChat.id, { file: file.file }])
|
||||
.dispatch('sendAttachment', [
|
||||
this.currentChat.id,
|
||||
{ file: file.file, isPrivate: this.isPrivate },
|
||||
])
|
||||
.then(() => {
|
||||
this.isUploading = false;
|
||||
this.$emit('scrollToMessage');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue