to show Home tab after it is activated from settings tab

pull/1/head
LianaHus 6 years ago
parent 91d96379f5
commit ae9da063ae
  1. 14
      src/app/panels/editor-panel.js
  2. 8
      src/app/tabs/compile-tab.js
  3. 1
      src/remixAppManager.js

@ -50,6 +50,13 @@ class EditorPanel {
pluginManager: self._components.registry.get('pluginmanager').api pluginManager: self._components.registry.get('pluginmanager').api
} }
self.tabProxy = new TabProxy(self._deps.fileManager, self._components.editor, self.appStore, self.appManager) self.tabProxy = new TabProxy(self._deps.fileManager, self._components.editor, self.appStore, self.appManager)
let showApp = function(name){
self.mainPanelComponent.showContent(name)
self._view.editor.style.display = 'none'
self._components.contextView.hide()
self._view.mainPanel.style.display = 'block'
}
self.appManager.event.on('ensureActivated', (name) => { if(name === 'home') showApp(name)})
/* /*
We listen here on event from the tab component to display / hide the editor and mainpanel We listen here on event from the tab component to display / hide the editor and mainpanel
depending on the content that should be displayed depending on the content that should be displayed
@ -65,12 +72,7 @@ class EditorPanel {
}) })
self.tabProxy.event.on('closeFile', (file) => { self.tabProxy.event.on('closeFile', (file) => {
}) })
self.tabProxy.event.on('switchApp', (name) => { self.tabProxy.event.on('switchApp', showApp)
self.mainPanelComponent.showContent(name)
self._view.editor.style.display = 'none'
self._components.contextView.hide()
self._view.mainPanel.style.display = 'block'
})
self.tabProxy.event.on('closeApp', (name) => { self.tabProxy.event.on('closeApp', (name) => {
self._view.editor.style.display = 'block' self._view.editor.style.display = 'block'
self._components.contextView.hide() self._components.contextView.hide()

@ -111,7 +111,8 @@ class CompileTab extends ApiFactory {
if (data['error']) { if (data['error']) {
this.renderer.error(data['error'].formattedMessage, this._view.errorContainer, {type: data['error'].severity || 'error'}) this.renderer.error(data['error'].formattedMessage, this._view.errorContainer, {type: data['error'].severity || 'error'})
if (data['error'].mode === 'panic') { if (data['error'].mode === 'panic') {
return modalDialogCustom.alert(yo`<div><i class="fa fa-exclamation-circle ${css.panicError}" aria-hidden="true"></i> return modalDialogCustom.alert(yo`
<div><i class="fa fa-exclamation-circle ${css.panicError}" aria-hidden="true"></i>
The compiler returned with the following internal error: <br> <b>${data['error'].formattedMessage}.<br> The compiler returned with the following internal error: <br> <b>${data['error'].formattedMessage}.<br>
The compiler might be in a non-sane state, please be careful and do not use further compilation data to deploy to mainnet. The compiler might be in a non-sane state, please be careful and do not use further compilation data to deploy to mainnet.
It is heavily recommended to use another browser not affected by this issue (Firefox is known to not be affected).</b><br> It is heavily recommended to use another browser not affected by this issue (Firefox is known to not be affected).</b><br>
@ -289,7 +290,10 @@ class CompileTab extends ApiFactory {
}) })
if (details[propertyName] !== '') { if (details[propertyName] !== '') {
try { try {
node = yo`<div>${treeView.render(typeof details[propertyName] === 'object' ? details[propertyName] : JSON.parse(details[propertyName]))}</div>` // catch in case the parsing fails. node = yo`
<div>
${treeView.render(typeof details[propertyName] === 'object' ? details[propertyName] : JSON.parse(details[propertyName]))}
</div>` // catch in case the parsing fails.
} catch (e) { } catch (e) {
node = yo`<div>Unable to display "${propertyName}": ${e.message}</div>` node = yo`<div>Unable to display "${propertyName}": ${e.message}</div>`
} }

@ -18,6 +18,7 @@ export class RemixAppManager extends AppManagerApi {
ensureActivated (apiName) { ensureActivated (apiName) {
if (!this.store.isActive(apiName)) this.activateOne(apiName) if (!this.store.isActive(apiName)) this.activateOne(apiName)
this.event.emit('ensureActivated', apiName)
} }
proxy () { proxy () {

Loading…
Cancel
Save