Eric Tröbs %!s(int64=4) %!d(string=hai) anos
pai
achega
b0d92b6830
Modificáronse 1 ficheiros con 5 adicións e 2 borrados
  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">
       <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"
              alt="confirm" src="@/assets/icons/check.svg"
@@ -80,7 +80,10 @@ export default {
       return Object.keys(this.labels).map(key => this.labels[key]);
     },
     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 () {
       const left = this.image.left;