Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] Non-reply attachments displaying time #2902

Merged
merged 4 commits into from
Apr 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/containers/message/Reply.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
10 changes: 8 additions & 2 deletions storybook/stories/Message.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
}]}
/>

Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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',
Expand All @@ -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',
Expand Down Expand Up @@ -833,6 +838,7 @@ export default ({ theme }) => {
author_name: 'rocket.cat',
ts: date,
timeFormat: 'LT',
message_link: 'http:///example.com',
text: 'First message'
}]}
/>
Expand Down