2
0
Эх сурвалжийг харах

fix NaN for uptime

Signed-off-by: shanghaikid <jiangruiyi@gmail.com>
shanghaikid 1 жил өмнө
parent
commit
c17b44b529

+ 6 - 4
client/src/pages/overview/Overview.tsx

@@ -197,10 +197,12 @@ const Overview = () => {
     let duration = 0;
     let unit = '';
     if (rootCoordCreatedTime) {
-      rootCoordCreatedTime = rootCoordCreatedTime.substring(
-        0,
-        rootCoordCreatedTime.lastIndexOf('m=')
-      );
+      if (rootCoordCreatedTime.lastIndexOf('m=')! == -1) {
+        rootCoordCreatedTime = rootCoordCreatedTime.substring(
+          0,
+          rootCoordCreatedTime.lastIndexOf('m=')
+        );
+      }
 
       const rootCoordCreatedTimeObj = dayjs(rootCoordCreatedTime);