diff --git a/webclient/src/Home.js b/webclient/src/Home.js index 215114a..41e324e 100644 --- a/webclient/src/Home.js +++ b/webclient/src/Home.js @@ -48,7 +48,7 @@ function MemberInfo(props) { Expiry: - {moment(member.expire_date).format('ll')} + {member.expire_date ? moment(member.expire_date).format('ll') : 'Unknown'} @@ -127,15 +127,15 @@ function MemberInfo(props) { Application: - {moment(member.application_date).format('ll') || 'Unknown'} + {member.application_date ? moment(member.application_date).format('ll') : 'Unknown'} Start: - {moment(member.current_start_date).format('ll') || 'Unknown'} + {member.current_start_date ? moment(member.current_start_date).format('ll') : 'Unknown'} Vetted: - {moment(member.vetted_date).format('ll') || 'Not vetted'} + {member.vetted_date ? moment(member.vetted_date).format('ll') : 'Not vetted'} Monthly dues: @@ -185,14 +185,14 @@ export function Home(props) { }); }, [refreshCount, token]); - const getStat = (x) => stats && stats[x] ? stats[x] : '?'; + const getStat = (x) => stats && stats[x] ? stats[x] : 'Unknown'; const getZeroStat = (x) => stats && stats[x] ? stats[x] : '0'; - const getDateStat = (x) => stats && stats[x] ? moment.utc(stats[x]).tz('America/Edmonton').format('ll') : '?'; + const getDateStat = (x) => stats && stats[x] ? moment.utc(stats[x]).tz('America/Edmonton').format('ll') : 'Unknown'; const mcPlayers = stats && stats['minecraft_players'] ? stats['minecraft_players'] : []; const mumbleUsers = stats && stats['mumble_users'] ? stats['mumble_users'] : []; - const getTrackStat = (x) => stats && stats.track && stats.track[x] ? moment().unix() - stats.track[x]['time'] > 60 ? 'Free' : 'In Use' : '?'; + const getTrackStat = (x) => stats && stats.track && stats.track[x] ? moment().unix() - stats.track[x]['time'] > 60 ? 'Free' : 'In Use' : 'Unknown'; const getTrackLast = (x) => stats && stats.track && stats.track[x] ? moment.unix(stats.track[x]['time']).tz('America/Edmonton').format('llll') : 'Unknown'; const getTrackAgo = (x) => stats && stats.track && stats.track[x] ? moment.unix(stats.track[x]['time']).tz('America/Edmonton').fromNow() : ''; const getTrackName = (x) => stats && stats.track && stats.track[x] && stats.track[x]['username'] ? stats.track[x]['username'] : 'Unknown';