Hide pinned panel if plugin is deactivated

pull/5370/head
ioedeveloper 6 months ago
parent 6f4d29e6e6
commit 3525435ed8
  1. 6
      apps/remix-ide/src/app/components/pinned-panel.tsx
  2. 9
      apps/remix-ide/src/app/components/side-panel.tsx

@ -25,6 +25,12 @@ export class PinnedPanel extends AbstractPanel {
onActivation() { onActivation() {
this.renderComponent() this.renderComponent()
this.on('sidePanel', 'pluginDisabled', (name) => {
if (this.plugins[name] && this.plugins[name].active) {
this.emit('unPinnedPlugin', name)
this.events.emit('unPinnedPlugin', name)
}
})
} }
async pinView (profile, view) { async pinView (profile, view) {

@ -58,10 +58,8 @@ export class SidePanel extends AbstractPanel {
} }
removeView(profile) { removeView(profile) {
if (this.plugins[profile.name].active) this.call('menuicons', 'select', 'filePanel') if (this.plugins[profile.name] && this.plugins[profile.name].active) this.call('menuicons', 'select', 'filePanel')
super.removeView(profile) super.removeView(profile)
this.emit('pluginDisabled', profile.name)
this.call('menuicons', 'unlinkContent', profile)
this.renderComponent() this.renderComponent()
} }
@ -73,7 +71,10 @@ export class SidePanel extends AbstractPanel {
async pinView (profile) { async pinView (profile) {
await this.call('pinnedPanel', 'pinView', profile, this.plugins[profile.name].view) await this.call('pinnedPanel', 'pinView', profile, this.plugins[profile.name].view)
this.removeView(profile) if (this.plugins[profile.name].active) this.call('menuicons', 'select', 'filePanel')
super.remove(profile.name)
this.call('menuicons', 'unlinkContent', profile)
this.renderComponent()
} }
async unPinView (profile, view) { async unPinView (profile, view) {

Loading…
Cancel
Save