fix: Update the logic to show read status for web (#6107)

This commit is contained in:
Pranav Raj S
2022-12-21 09:58:56 -08:00
parent 8e13a06833
commit a3e5aad753
5 changed files with 75 additions and 76 deletions

View File

@@ -15,7 +15,6 @@
v-if="data.content"
:message="message"
:is-email="isEmailContentType"
:readable-time="readableTime"
:display-quoted-button="displayQuotedButton"
/>
<span
@@ -29,7 +28,6 @@
<bubble-image
v-if="attachment.file_type === 'image' && !hasImageError"
:url="attachment.data_url"
:readable-time="readableTime"
@error="onImageLoadError"
/>
<audio v-else-if="attachment.file_type === 'audio'" controls>
@@ -38,7 +36,6 @@
<bubble-video
v-else-if="attachment.file_type === 'video'"
:url="attachment.data_url"
:readable-time="readableTime"
/>
<bubble-location
v-else-if="attachment.file_type === 'location'"
@@ -46,11 +43,7 @@
:longitude="attachment.coordinates_long"
:name="attachment.fallback_title"
/>
<bubble-file
v-else
:url="attachment.data_url"
:readable-time="readableTime"
/>
<bubble-file v-else :url="attachment.data_url" />
</div>
</div>
<bubble-actions
@@ -65,10 +58,9 @@
:is-private="data.private"
:message-type="data.message_type"
:message-status="status"
:readable-time="readableTime"
:source-id="data.source_id"
:inbox-id="data.inbox_id"
:message-read="showReadTicks"
:created-at="createdAt"
/>
</div>
<spinner v-if="isPending" size="tiny" />
@@ -119,8 +111,6 @@
</template>
<script>
import messageFormatterMixin from 'shared/mixins/messageFormatterMixin';
import timeMixin from '../../../mixins/time';
import BubbleMailHead from './bubble/MailHead';
import BubbleText from './bubble/Text';
import BubbleImage from './bubble/Image';
@@ -149,7 +139,7 @@ export default {
ContextMenu,
Spinner,
},
mixins: [alertMixin, timeMixin, messageFormatterMixin, contentTypeMixin],
mixins: [alertMixin, messageFormatterMixin, contentTypeMixin],
props: {
data: {
type: Object,
@@ -167,10 +157,6 @@ export default {
type: Boolean,
default: false,
},
hasUserReadMessage: {
type: Boolean,
default: false,
},
isWebWidgetInbox: {
type: Boolean,
default: false,
@@ -273,11 +259,8 @@ export default {
'has-tweet-menu': this.isATweet,
};
},
readableTime() {
return this.messageStamp(
this.contentAttributes.external_created_at || this.data.created_at,
'LLL d, h:mm a'
);
createdAt() {
return this.contentAttributes.external_created_at || this.data.created_at;
},
isBubble() {
return [0, 1, 3].includes(this.data.message_type);
@@ -288,14 +271,6 @@ export default {
isOutgoing() {
return this.data.message_type === MESSAGE_TYPE.OUTGOING;
},
showReadTicks() {
return (
(this.isOutgoing || this.isTemplate) &&
this.hasUserReadMessage &&
this.isWebWidgetInbox &&
!this.data.private
);
},
isTemplate() {
return this.data.message_type === MESSAGE_TYPE.TEMPLATE;
},