Bläddra i källkod

fix AdminTicketShow.vue category options

ali 2 år sedan
förälder
incheckning
32086de1c8
1 ändrade filer med 9 tillägg och 6 borttagningar
  1. 9 6
      src/components/Widgets/Ticket/AdminTicketShow/AdminTicketShow.vue

+ 9 - 6
src/components/Widgets/Ticket/AdminTicketShow/AdminTicketShow.vue

@@ -185,6 +185,7 @@ export default {
       mounted: false,
       entityLoading: true,
       packageTitle: '',
+      firstChangeOfSelectedCategoryInfoType: false,
       ticket: new Ticket(),
       authenticatedUser: new User(),
       api: APIGateway.ticket.APIAdresses.byId(ticketId),
@@ -241,6 +242,10 @@ export default {
   },
   watch: {
     selectedCategoryInfoType () {
+      if (!this.firstChangeOfSelectedCategoryInfoType) {
+        this.firstChangeOfSelectedCategoryInfoType = true
+        return
+      }
       FormBuilderAssist.setAttributeByName(this.inputs, 'category', 'value', null)
       this.loadCategories()
     }
@@ -255,14 +260,11 @@ export default {
     this.loadAuthData()
     this.checkSource()
     this.loadOptions()
-      .then(() => {
+      .finally(() => {
         this.$nextTick(() => {
           this.mounted = true
         })
       })
-      .catch(() => {
-        this.mounted = true
-      })
   },
   methods: {
     closeTicket () {
@@ -374,17 +376,18 @@ export default {
                 label: item.title
               }
             }))
-            this.categoriesLoading = false
             this.$nextTick(() => {
               resolve()
             })
           })
           .catch(() => {
-            this.categoriesLoading = false
             this.$nextTick(() => {
               reject()
             })
           })
+          .finally(() => {
+            this.categoriesLoading = false
+          })
       })
     },
     sendReply() {