Explorar el Código

fix NaN for uptime

Signed-off-by: shanghaikid <jiangruiyi@gmail.com>
shanghaikid hace 1 año
padre
commit
c17b44b529
Se han modificado 1 ficheros con 6 adiciones y 4 borrados
  1. 6 4
      client/src/pages/overview/Overview.tsx

+ 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);