[FIX] Non-reply attachments displaying time (#2902)
* Remove time if no message_link * Fix message stories for replies * Final stories fix Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
parent
d6200745c0
commit
28ab90857c
|
@ -73,7 +73,7 @@ const Title = React.memo(({ attachment, timeFormat, theme }) => {
|
|||
if (!attachment.author_name) {
|
||||
return null;
|
||||
}
|
||||
const time = attachment.ts ? moment(attachment.ts).format(timeFormat) : null;
|
||||
const time = attachment.message_link && attachment.ts ? moment(attachment.ts).format(timeFormat) : null;
|
||||
return (
|
||||
<View style={styles.authorContainer}>
|
||||
{attachment.author_name ? <Text style={[styles.author, { color: themes[theme].bodyText }]}>{attachment.author_name}</Text> : null}
|
||||
|
|
|
@ -440,7 +440,8 @@ export default ({ theme }) => {
|
|||
author_name: 'I\'m a very long long title and I\'ll break',
|
||||
ts: date,
|
||||
timeFormat: 'LT',
|
||||
text: 'How are you?'
|
||||
text: 'How are you?',
|
||||
message_link: 'http:///example.com'
|
||||
}]}
|
||||
/>
|
||||
<Message
|
||||
|
@ -449,7 +450,8 @@ export default ({ theme }) => {
|
|||
author_name: 'rocket.cat',
|
||||
ts: date,
|
||||
timeFormat: 'LT',
|
||||
text: 'How are you? :nyan_rocket:'
|
||||
text: 'How are you? :nyan_rocket:',
|
||||
message_link: 'http:///example.com'
|
||||
}]}
|
||||
/>
|
||||
|
||||
|
@ -702,6 +704,7 @@ export default ({ theme }) => {
|
|||
ts: date,
|
||||
timeFormat: 'LT',
|
||||
text: 'Custom fields',
|
||||
message_link: 'http:///example.com',
|
||||
fields: [{
|
||||
title: 'Field 1',
|
||||
value: 'Value 1'
|
||||
|
@ -729,6 +732,7 @@ export default ({ theme }) => {
|
|||
ts: date,
|
||||
timeFormat: 'LT',
|
||||
text: 'Custom fields',
|
||||
message_link: 'http:///example.com',
|
||||
fields: [{
|
||||
title: 'Field 1',
|
||||
value: 'Value 1',
|
||||
|
@ -743,6 +747,7 @@ export default ({ theme }) => {
|
|||
ts: date,
|
||||
timeFormat: 'LT',
|
||||
text: 'Custom fields 2',
|
||||
message_link: 'http:///example.com',
|
||||
fields: [{
|
||||
title: 'Field 1',
|
||||
value: 'Value 1',
|
||||
|
@ -833,6 +838,7 @@ export default ({ theme }) => {
|
|||
author_name: 'rocket.cat',
|
||||
ts: date,
|
||||
timeFormat: 'LT',
|
||||
message_link: 'http:///example.com',
|
||||
text: 'First message'
|
||||
}]}
|
||||
/>
|
||||
|
|
Loading…
Reference in New Issue