pass the correct message id when there is an attachment on reply
This commit is contained in:
parent
58f73e1d09
commit
67ba3131e3
|
@ -3,6 +3,7 @@ import { StyleSheet, Text, View } from 'react-native';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { dequal } from 'dequal';
|
import { dequal } from 'dequal';
|
||||||
import FastImage from 'react-native-fast-image';
|
import FastImage from 'react-native-fast-image';
|
||||||
|
import parse from 'url-parse';
|
||||||
|
|
||||||
import Touchable from './Touchable';
|
import Touchable from './Touchable';
|
||||||
import Markdown from '../markdown';
|
import Markdown from '../markdown';
|
||||||
|
@ -225,6 +226,12 @@ const Reply = React.memo(
|
||||||
openLink(url, theme);
|
openLink(url, theme);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let attachmentId = '';
|
||||||
|
if (attachment.message_link) {
|
||||||
|
const parsedUrl = parse(attachment.message_link, true);
|
||||||
|
attachmentId = parsedUrl.query.msg || messageId;
|
||||||
|
}
|
||||||
|
|
||||||
let { borderColor } = themes[theme];
|
let { borderColor } = themes[theme];
|
||||||
if (attachment.color) {
|
if (attachment.color) {
|
||||||
borderColor = attachment.color;
|
borderColor = attachment.color;
|
||||||
|
@ -257,7 +264,7 @@ const Reply = React.memo(
|
||||||
timeFormat={timeFormat}
|
timeFormat={timeFormat}
|
||||||
style={[{ color: themes[theme].auxiliaryTintColor, fontSize: 14, marginBottom: 8 }]}
|
style={[{ color: themes[theme].auxiliaryTintColor, fontSize: 14, marginBottom: 8 }]}
|
||||||
isReply
|
isReply
|
||||||
id={messageId}
|
id={attachmentId}
|
||||||
/>
|
/>
|
||||||
<Fields attachment={attachment} getCustomEmoji={getCustomEmoji} theme={theme} />
|
<Fields attachment={attachment} getCustomEmoji={getCustomEmoji} theme={theme} />
|
||||||
{loading ? (
|
{loading ? (
|
||||||
|
|
Loading…
Reference in New Issue