From 2bf250a85d1e7e6735a2028b91d519fae0127cca Mon Sep 17 00:00:00 2001
From: "mathias.chouet" <mathias.chouet@irstea.fr>
Date: Wed, 3 Jul 2019 11:39:36 +0200
Subject: [PATCH] Removed unused code

---
 src/app/services/formulaire/formulaire.service.ts | 15 ++-------------
 1 file changed, 2 insertions(+), 13 deletions(-)

diff --git a/src/app/services/formulaire/formulaire.service.ts b/src/app/services/formulaire/formulaire.service.ts
index ec077467e..7433bb631 100644
--- a/src/app/services/formulaire/formulaire.service.ts
+++ b/src/app/services/formulaire/formulaire.service.ts
@@ -333,20 +333,9 @@ export class FormulaireService extends Observable {
                 }
             }
 
-            // add fieldsets for existing PabCloisons if needed
-            // (when loading session only)
-            if (f.currentNub instanceof Pab) {
-                for (const child of f.currentNub.children) {
-                    for (const e of f.allFormElements) {
-                        if (e instanceof FieldsetContainer) { // @TODO manage many containers one day ?
-                            e.addFromTemplate(0, undefined, child);
-                        }
-                    }
-                }
-            }
-
             // when creating a new Pab, add one wall with one device, plus the downwall
-            if (f instanceof FormulairePab) {
+            // (when loading session only)
+            if (f instanceof FormulairePab && f.currentNub instanceof Pab) {
                 // 1. one wall
                 const newWall = Session.getInstance().createNub(
                     new Props({
-- 
GitLab