Merge branch 'master' into fix_save

pull/5370/head
bunsenstraat 3 years ago committed by GitHub
commit 492628b079
  1. 2
      apps/remix-ide/src/app/files/fileManager.ts
  2. 12
      apps/remix-ide/src/app/panels/tab-proxy.js
  3. 3
      apps/remix-ide/src/app/plugins/remixd-handle.tsx
  4. 2
      libs/remix-ui/solidity-compiler/src/lib/compiler-container.tsx

@ -484,7 +484,7 @@ class FileManager extends Plugin {
this.emit('filesAllClosed') this.emit('filesAllClosed')
this.events.emit('filesAllClosed') this.events.emit('filesAllClosed')
for (const file in this.openedFiles) { for (const file in this.openedFiles) {
this.closeFile(file) await this.closeFile(file)
} }
} }

@ -50,10 +50,18 @@ export class TabProxy extends Plugin {
this.on('fileManager', 'fileClosed', (name) => { this.on('fileManager', 'fileClosed', (name) => {
const workspace = this.fileManager.currentWorkspace() const workspace = this.fileManager.currentWorkspace()
if (this.fileManager.mode === 'browser') { if (this.fileManager.mode === 'browser') {
name = name.startsWith(workspace + '/') ? name : workspace + '/' + name name = name.startsWith(workspace + '/') ? name : workspace + '/' + name
this.removeTab(name) let tabIndex = this.loadedTabs.findIndex(tab => tab.name === name)
// If tab doesn't exist, check if tab is opened because of abrupt disconnection with remixd
if (tabIndex === -1) {
const nameArray = name.split('/')
nameArray.shift()
name = 'localhost' + '/' + nameArray.join('/')
tabIndex = this.loadedTabs.findIndex(tab => tab.name === name)
if(tabIndex !== -1) this.removeTab(name)
} else this.removeTab(name)
} else { } else {
name = name.startsWith(this.fileManager.mode + '/') ? name : this.fileManager.mode + '/' + name name = name.startsWith(this.fileManager.mode + '/') ? name : this.fileManager.mode + '/' + name
this.removeTab(name) this.removeTab(name)

@ -76,10 +76,9 @@ export class RemixdHandle extends WebsocketPlugin {
const intervalId = setInterval(() => { const intervalId = setInterval(() => {
if (!this.socket || (this.socket && this.socket.readyState === 3)) { // 3 means connection closed if (!this.socket || (this.socket && this.socket.readyState === 3)) { // 3 means connection closed
clearInterval(intervalId) clearInterval(intervalId)
console.log(error)
const alert:AlertModal = { const alert:AlertModal = {
id: 'connectionAlert', id: 'connectionAlert',
message: 'Connection to remixd terminated.Please make sure remixd is still running in the background.' message: 'Connection to remixd terminated. Please make sure remixd is still running in the background.'
} }
this.call('notification', 'alert', alert) this.call('notification', 'alert', alert)
this.canceled() this.canceled()

@ -624,7 +624,7 @@ export const CompilerContainer = (props: CompilerContainerProps) => {
<div className="mt-3 remixui_compilerConfig custom-control custom-checkbox"> <div className="mt-3 remixui_compilerConfig custom-control custom-checkbox">
<input className="remixui_autocompile custom-control-input" onChange={updateTruffleCompilation} id="enableTruffle" type="checkbox" title="Enable Truffle Compilation" checked={truffleCompilation} /> <input className="remixui_autocompile custom-control-input" onChange={updateTruffleCompilation} id="enableTruffle" type="checkbox" title="Enable Truffle Compilation" checked={truffleCompilation} />
<label className="form-check-label custom-control-label" htmlFor="enableTruffle">Enable Truffle Compilation</label> <label className="form-check-label custom-control-label" htmlFor="enableTruffle">Enable Truffle Compilation</label>
<a className="mt-1 text-nowrap" href='https://remix-ide.readthedocs.io/en/latest/' target={'_blank'}> <a className="mt-1 text-nowrap" href='https://remix-ide.readthedocs.io/en/latest/truffle.html#enable-truffle-compilation' target={'_blank'}>
<OverlayTrigger placement={'right'} overlay={ <OverlayTrigger placement={'right'} overlay={
<Tooltip className="text-nowrap" id="overlay-tooltip-truffle"> <Tooltip className="text-nowrap" id="overlay-tooltip-truffle">
<span className="p-1 pr-3" style={{ backgroundColor: 'black', minWidth: '230px' }}>Learn how to use Truffle Compilation</span> <span className="p-1 pr-3" style={{ backgroundColor: 'black', minWidth: '230px' }}>Learn how to use Truffle Compilation</span>

Loading…
Cancel
Save