From a2af6b5fd68bfc2ebc5cc7d58efc7accf6eb5d8c Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Fri, 8 Jun 2018 16:18:14 -0400 Subject: [PATCH] Fix inApp notification handler (#1749) --- app/screens/entry/entry.js | 2 +- app/screens/notification/notification.js | 38 ++++++++++++++++++++---- 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/app/screens/entry/entry.js b/app/screens/entry/entry.js index 9c4622cee..afda50b5c 100644 --- a/app/screens/entry/entry.js +++ b/app/screens/entry/entry.js @@ -227,7 +227,7 @@ export default class Entry extends PureComponent { navigator: this.props.navigator, }; - return wrapWithContextProvider(ChannelScreen, true)(props); + return wrapWithContextProvider(ChannelScreen, false)(props); }; render() { diff --git a/app/screens/notification/notification.js b/app/screens/notification/notification.js index 8efa23e59..1a949e018 100644 --- a/app/screens/notification/notification.js +++ b/app/screens/notification/notification.js @@ -92,8 +92,28 @@ export default class Notification extends PureComponent { return icon; }; - getNotificationTitle = (titleText) => { + getNotificationTitle = (notification) => { const {channel} = this.props; + const {message, data} = notification; + + if (data.version === 'v2') { + if (data.channel_name) { + return ( + + {data.channel_name} + + ); + } + + return null; + } + + const msg = message.split(':'); + const titleText = msg.shift(); let title = (