Skip to content

Commit 883feb6

Browse files
joeizangAniket-Engg
authored andcommitted
fix bug
1 parent d924dd8 commit 883feb6

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

apps/remix-ide/src/app/components/side-panel.tsx

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,28 @@ export class SidePanel extends AbstractPanel {
7070
}
7171

7272
async pinView (profile) {
73+
const active = this.currentFocus()
7374
await this.call('pinnedPanel', 'pinView', profile, this.plugins[profile.name]?.view)
74-
if (this.plugins[profile.name].active) this.call('menuicons', 'select', 'filePanel')
75+
if (this.plugins[profile.name].active) {
76+
this.call('menuicons', 'select', 'filePanel')
77+
}
78+
if (active === profile.name) this.call('menuicons', 'select', active.length > 1 ? active : 'filePanel')
7579
super.remove(profile.name)
7680
this.renderComponent()
7781
}
7882

7983
async unPinView (profile, view) {
8084
const activePlugin = this.currentFocus()
81-
8285
if (activePlugin === profile.name) throw new Error(`Plugin ${profile.name} already unpinned`)
8386
this.loggedState = await this.call('pluginStateLogger', 'getPluginState', profile.name)
8487
super.addView(profile, view)
8588
this.plugins[activePlugin].active = false
8689
this.plugins[profile.name].active = true
87-
this.showContent(profile.name)
90+
if (profile.name !== 'remixaiassistant') {
91+
this.showContent(profile.name)
92+
}
93+
this.emit('focusChanged', profile.name)
94+
// this.showContent(profile.name)
8895
}
8996

9097
/**
@@ -93,8 +100,9 @@ export class SidePanel extends AbstractPanel {
93100
*/
94101
async showContent(name) {
95102
super.showContent(name)
96-
if (name === 'remixaiassistant') { // TODO: should this be a plugin feature?
97-
this.pinView(this.plugins[name].profile)
103+
if (name === 'remixaiassistant') {
104+
await this.call('sidePanel', 'pinView', this.plugins[name].profile)
105+
return
98106
}
99107
this.emit('focusChanged', name)
100108
this.renderComponent()

0 commit comments

Comments
 (0)