Hide pinned panel if plugin is deactivated

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

@ -25,12 +25,18 @@ export class PinnedPanel extends AbstractPanel {
onActivation() {
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) {
const activePlugin = this.currentFocus()
if (activePlugin === profile.name) throw new Error(`Plugin ${profile.name} already pinned`)
if (activePlugin === profile.name) throw new Error(`Plugin ${profile.name} already pinned`)
if (activePlugin) {
await this.call('sidePanel', 'unPinView', this.plugins[activePlugin].profile, this.plugins[activePlugin].view)
this.remove(activePlugin)

@ -58,10 +58,8 @@ export class SidePanel extends AbstractPanel {
}
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)
this.emit('pluginDisabled', profile.name)
this.call('menuicons', 'unlinkContent', profile)
this.renderComponent()
}
@ -73,7 +71,10 @@ export class SidePanel extends AbstractPanel {
async pinView (profile) {
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) {

Loading…
Cancel
Save