浏览代码

fixed the selection of the correct label name

Dimitri Korsch 3 年之前
父节点
当前提交
fb01307b99
共有 1 个文件被更改,包括 9 次插入2 次删除
  1. 9 2
      webui/src/components/media/cropped-image.vue

+ 9 - 2
webui/src/components/media/cropped-image.vue

@@ -51,8 +51,15 @@
             if (this.box.label_id == null)
             if (this.box.label_id == null)
               return 'Unknown'
               return 'Unknown'
 
 
-            var label = this.labels[this.box.label_id]
-            return label.name
+            let name = 'Not Found';
+            for (let label of this.labels){
+              if (label.id != this.box.label_id)
+                continue;
+
+              name = label.name;
+              break;
+            }
+            return name
           },
           },
 
 
         },
         },