[FIX] In-app notification showing wrong content on channels (#1400)
This commit is contained in:
parent
29302ccd08
commit
89209a954a
|
@ -48,6 +48,9 @@ const styles = StyleSheet.create({
|
||||||
flexDirection: 'row',
|
flexDirection: 'row',
|
||||||
alignItems: 'center'
|
alignItems: 'center'
|
||||||
},
|
},
|
||||||
|
inner: {
|
||||||
|
flex: 1
|
||||||
|
},
|
||||||
avatar: {
|
avatar: {
|
||||||
marginRight: 10
|
marginRight: 10
|
||||||
},
|
},
|
||||||
|
@ -160,7 +163,7 @@ class NotificationBadge extends React.Component {
|
||||||
if (!rid) {
|
if (!rid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const name = type === 'p' ? payload.name : payload.sender.username;
|
const name = type === 'd' ? payload.sender.username : payload.name;
|
||||||
await navigation.navigate('RoomsListView');
|
await navigation.navigate('RoomsListView');
|
||||||
navigation.navigate('RoomView', {
|
navigation.navigate('RoomView', {
|
||||||
rid, name, t: type, prid
|
rid, name, t: type, prid
|
||||||
|
@ -174,7 +177,7 @@ class NotificationBadge extends React.Component {
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const { message, payload } = notification;
|
const { message, payload } = notification;
|
||||||
const { type } = payload;
|
const { type } = payload;
|
||||||
const name = type === 'p' ? payload.name : payload.sender.username;
|
const name = type === 'd' ? payload.sender.username : payload.name;
|
||||||
|
|
||||||
let top = 0;
|
let top = 0;
|
||||||
if (isIOS) {
|
if (isIOS) {
|
||||||
|
@ -186,8 +189,6 @@ class NotificationBadge extends React.Component {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const maxWidthMessage = window.width - 110;
|
|
||||||
|
|
||||||
const translateY = this.animatedValue.interpolate({
|
const translateY = this.animatedValue.interpolate({
|
||||||
inputRange: [0, 1],
|
inputRange: [0, 1],
|
||||||
outputRange: [-top - ROW_HEIGHT, top]
|
outputRange: [-top - ROW_HEIGHT, top]
|
||||||
|
@ -202,9 +203,9 @@ class NotificationBadge extends React.Component {
|
||||||
>
|
>
|
||||||
<>
|
<>
|
||||||
<Avatar text={name} size={AVATAR_SIZE} type={type} baseUrl={baseUrl} style={styles.avatar} userId={userId} token={token} />
|
<Avatar text={name} size={AVATAR_SIZE} type={type} baseUrl={baseUrl} style={styles.avatar} userId={userId} token={token} />
|
||||||
<View>
|
<View style={styles.inner}>
|
||||||
<Text style={styles.roomName}>{name}</Text>
|
<Text style={styles.roomName} numberOfLines={1}>{name}</Text>
|
||||||
<Text style={[styles.message, { maxWidth: maxWidthMessage }]} numberOfLines={1}>{message}</Text>
|
<Text style={styles.message} numberOfLines={1}>{message}</Text>
|
||||||
</View>
|
</View>
|
||||||
</>
|
</>
|
||||||
</Touchable>
|
</Touchable>
|
||||||
|
|
Loading…
Reference in New Issue