From 5e039612130c3c567fb50da9ce5f2e955787ac6e Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 24 May 2022 08:23:47 -0700 Subject: Optimize status text --- modern/src/main/DevicesList.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'modern/src/main') diff --git a/modern/src/main/DevicesList.js b/modern/src/main/DevicesList.js index fe963124..057ae28d 100644 --- a/modern/src/main/DevicesList.js +++ b/modern/src/main/DevicesList.js @@ -75,12 +75,11 @@ const DeviceRow = ({ data, index, style }) => { const position = useSelector((state) => state.positions.items[item.id]); const secondaryText = () => { - const status = formatStatus(item.status, t); - if (item.lastUpdate) { - const lastUpdate = moment(item.lastUpdate).fromNow(); - return `${status} ${lastUpdate}`; + if (item.status === 'online' || !item.lastUpdate) { + return formatStatus(item.status, t); + } else { + return moment(item.lastUpdate).fromNow(); } - return status; }; return ( -- cgit v1.2.3