From 7def165547c952472546b97b02e367f73c61cf2b Mon Sep 17 00:00:00 2001 From: keplyx Date: Wed, 5 Feb 2020 09:46:10 +0100 Subject: [PATCH] Improved planning display screen and fixed crash when no event on home --- screens/HomeScreen.js | 7 ++++++- screens/PlanningDisplayScreen.js | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/screens/HomeScreen.js b/screens/HomeScreen.js index f66eb60..6a2ef12 100644 --- a/screens/HomeScreen.js +++ b/screens/HomeScreen.js @@ -310,7 +310,12 @@ export default class HomeScreen extends FetchedDataSectionList { ; } else subtitle = i18n.t('homeScreen.dashboard.todayEventsSubtitleNA'); - let clickAction = () => this.props.navigation.navigate('PlanningDisplayScreen', {data: displayEvent}); + let clickAction = () => { + if (isAvailable) + this.props.navigation.navigate('PlanningDisplayScreen', {data: displayEvent}); + else + this.props.navigation.navigate('PlanningScreen'); + }; let displayEvent = this.getDisplayEvent(futureEvents); diff --git a/screens/PlanningDisplayScreen.js b/screens/PlanningDisplayScreen.js index 10a611d..be07370 100644 --- a/screens/PlanningDisplayScreen.js +++ b/screens/PlanningDisplayScreen.js @@ -37,6 +37,12 @@ export default class PlanningDisplayScreen extends React.Component {

{displayData.title}

+

+ {PlanningEventManager.getFormattedTime(displayData)} +

{displayData.logo !== null ?