File tree Expand file tree Collapse file tree 1 file changed +5
-12
lines changed
Expand file tree Collapse file tree 1 file changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -74,20 +74,13 @@ class ExtensionManager {
7474
7575 async togglePanel ( panelType ) {
7676 try {
77- const existingPanelInDOM = this . panels . get ( panelType ) ;
77+ const panel = this . panels . get ( panelType ) ;
7878
79- if ( existingPanelInDOM && existingPanelInDOM . isVisible ) {
80- // Panel exists and is visible -> hide it
81- await existingPanelInDOM . hide ( ) ;
82- } else if ( existingPanelInDOM && ! existingPanelInDOM . isVisible ) {
83- // Panel exists but hidden -> ensure it's initialized and show it
84- if ( ! existingPanelInDOM . container || ! existingPanelInDOM . container . parentNode ) {
85- // Re-initialize if container is missing or not in DOM
86- await existingPanelInDOM . initialize ( ) ;
87- }
88- await existingPanelInDOM . show ( ) ;
79+ if ( panel && panel . isVisible ) {
80+ // Panel is visible -> close it
81+ this . closePanel ( panelType ) ;
8982 } else {
90- // Panel doesn't exist -> create and open it
83+ // Panel doesn't exist or is hidden -> open it
9184 await this . openPanel ( panelType ) ;
9285 }
9386 }
You can’t perform that action at this time.
0 commit comments