From 3bc892fc9295684fb7b8a341d6ce774709331f7e Mon Sep 17 00:00:00 2001 From: ammarahm-ed Date: Tue, 23 Feb 2021 15:45:42 +0500 Subject: [PATCH] fix possible crash due to null value in toast --- apps/mobile/src/components/Toast/index.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/mobile/src/components/Toast/index.js b/apps/mobile/src/components/Toast/index.js index 85e04d5aa..dd3661439 100644 --- a/apps/mobile/src/components/Toast/index.js +++ b/apps/mobile/src/components/Toast/index.js @@ -37,7 +37,7 @@ export const Toast = ({context = 'global'}) => { } toastMessages.push(data); if (toastMessages?.length > 1) return; - + console.log(data); setData(data); if (data.type === 'success') { setToastStyle({ @@ -199,7 +199,7 @@ export const Toast = ({context = 'global'}) => { flexGrow: 1, paddingRight: 25, }}> - {data?.heading && ( + {data?.heading ? ( { }}> {data.heading} - )} + ) : null} - {data?.message && ( + {data?.message ? ( { @@ -218,7 +218,7 @@ export const Toast = ({context = 'global'}) => { }}> {data.message} - )} + ) : null}