From c1ad7d81f43b1c0b784bfcbefeb7a754fb8c042c Mon Sep 17 00:00:00 2001 From: Pradip Parkale Date: Mon, 3 Jan 2022 17:47:22 +0530 Subject: [PATCH] =?UTF-8?q?Fixed=20an=20issue=20where=20destroy=20method?= =?UTF-8?q?=20is=20not=20present=20for=20the=20browser=C2=A0tree=20after?= =?UTF-8?q?=20React=20porting.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/pgadmin/static/js/tree/tree.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/web/pgadmin/static/js/tree/tree.js b/web/pgadmin/static/js/tree/tree.js index c527ffc87..ab75728c1 100644 --- a/web/pgadmin/static/js/tree/tree.js +++ b/web/pgadmin/static/js/tree/tree.js @@ -92,6 +92,15 @@ export class Tree { return await this.tree.create(item, data); } + async destroy() { + const model = this.tree.getModel(); + this.rootNode.children = []; + if (model.root) { + model.root.isExpanded = false; + await model.root.hardReloadChildren(); + } + } + next(item) { if(item) { let parent = this.parent(item);