Browse Source

hotfix, create page node not properly updating with multiple locations

AVMG20 3 years ago
parent
commit
251614c507
1 changed files with 4 additions and 1 deletions
  1. 4 1
      resources/views/servers/create.blade.php

+ 4 - 1
resources/views/servers/create.blade.php

@@ -411,8 +411,11 @@
                     this.selectedNestObject = this.nests.find(nest => nest.id == this.selectedNest) ?? {}
                     this.selectedEggObject = this.eggs.find(egg => egg.id == this.selectedEgg) ?? {}
 
+                    this.selectedNodeObject = {};
                     this.locations.forEach(location => {
-                        this.selectedNodeObject = location.nodes.find(node => node.id == this.selectedNode) ?? {};
+                        if (!this.selectedNodeObject?.id) {
+                            this.selectedNodeObject = location.nodes.find(node => node.id == this.selectedNode) ?? {};
+                        }
                     })
 
                     this.selectedProductObject = this.products.find(product => product.id == this.selectedProduct) ?? {}