Unverified Commit 0d5e50eb authored by yash-rajpal's avatar yash-rajpal Committed by GitHub
Browse files

[FIX] Real name setting ignored on reply preview (#2908)


Co-authored-by: default avatarDiego Mello <diegolmello@gmail.com>
parent ba3de14a
...@@ -43,7 +43,7 @@ const styles = StyleSheet.create({ ...@@ -43,7 +43,7 @@ const styles = StyleSheet.create({
}); });
const ReplyPreview = React.memo(({ const ReplyPreview = React.memo(({
message, Message_TimeFormat, baseUrl, username, replying, getCustomEmoji, close, theme message, Message_TimeFormat, baseUrl, username, replying, getCustomEmoji, close, theme, useRealName
}) => { }) => {
if (!replying) { if (!replying) {
return null; return null;
...@@ -59,7 +59,7 @@ const ReplyPreview = React.memo(({ ...@@ -59,7 +59,7 @@ const ReplyPreview = React.memo(({
> >
<View style={[styles.messageContainer, { backgroundColor: themes[theme].chatComponentBackground }]}> <View style={[styles.messageContainer, { backgroundColor: themes[theme].chatComponentBackground }]}>
<View style={styles.header}> <View style={styles.header}>
<Text style={[styles.username, { color: themes[theme].tintColor }]}>{message.u?.username}</Text> <Text style={[styles.username, { color: themes[theme].tintColor }]}>{useRealName ? message.u?.name : message.u?.username}</Text>
<Text style={[styles.time, { color: themes[theme].auxiliaryText }]}>{time}</Text> <Text style={[styles.time, { color: themes[theme].auxiliaryText }]}>{time}</Text>
</View> </View>
<Markdown <Markdown
...@@ -85,12 +85,14 @@ ReplyPreview.propTypes = { ...@@ -85,12 +85,14 @@ ReplyPreview.propTypes = {
baseUrl: PropTypes.string.isRequired, baseUrl: PropTypes.string.isRequired,
username: PropTypes.string.isRequired, username: PropTypes.string.isRequired,
getCustomEmoji: PropTypes.func, getCustomEmoji: PropTypes.func,
theme: PropTypes.string theme: PropTypes.string,
useRealName: PropTypes.bool
}; };
const mapStateToProps = state => ({ const mapStateToProps = state => ({
Message_TimeFormat: state.settings.Message_TimeFormat, Message_TimeFormat: state.settings.Message_TimeFormat,
baseUrl: state.server.server baseUrl: state.server.server,
useRealName: state.settings.UI_Use_Real_Name
}); });
export default connect(mapStateToProps)(ReplyPreview); export default connect(mapStateToProps)(ReplyPreview);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment