Browse Source

优化剩余时间计算

Michael Wang 3 năm trước cách đây
mục cha
commit
8fd154b191

+ 1 - 0
src/features/OnlineExam/Examing/FaceTracking.vue

@@ -271,6 +271,7 @@ let detectFacesTimeout: number;
 
 /** 定时检测人脸 */
 async function detectFaces() {
+  if (import.meta.env.DEV) return;
   if (
     disableFaceTracking ||
     singleTimeUsage > 10 * 1000 ||

+ 3 - 1
src/features/OnlineExam/Examing/RemainTime.vue

@@ -15,7 +15,9 @@ let remainTime: number | null = $ref(null);
 let enhancedRemainTimeStyle = $ref(true);
 
 const remainTimeFormatted = $computed(() =>
-  remainTime ? moment.utc(remainTime).format("HH:mm:ss") : "计算中"
+  typeof remainTime === "number"
+    ? moment.utc(remainTime).format("HH:mm:ss")
+    : "计算中"
 );
 
 const { addTimeout, addInterval } = useTimers();