6
0
Eric Tröbs 4 سال پیش
والد
کامیت
b0d92b6830
1فایلهای تغییر یافته به همراه5 افزوده شده و 2 حذف شده
  1. 5 2
      webui/src/components/media/annotation-box.vue

+ 5 - 2
webui/src/components/media/annotation-box.vue

@@ -7,7 +7,7 @@
 
 
     <div class="buttons">
     <div class="buttons">
       <template v-if="!immutable">
       <template v-if="!immutable">
-        <div v-if="position.label" class="label-text">{{ currentLabel !== undefined ? currentLabel.name : '' }}</div>
+        <div v-if="position.label" class="label-text">{{ currentLabel ? currentLabel.name : 'unknown label' }}</div>
 
 
         <img v-if="confirmationButton"
         <img v-if="confirmationButton"
              alt="confirm" src="@/assets/icons/check.svg"
              alt="confirm" src="@/assets/icons/check.svg"
@@ -80,7 +80,10 @@ export default {
       return Object.keys(this.labels).map(key => this.labels[key]);
       return Object.keys(this.labels).map(key => this.labels[key]);
     },
     },
     currentLabel: function () {
     currentLabel: function () {
-      return this.labels[this.position.label];
+      if (this.position.label in this.labels)
+        return this.labels[this.position.label];
+      else
+        return false;
     },
     },
     style: function () {
     style: function () {
       const left = this.image.left;
       const left = this.image.left;