fix referesh

pull/1647/head
filip mertens 3 years ago
parent 86561ca9d6
commit fdcadd6f9a
  1. 40
      apps/remix-ide/src/app/files/dgitProvider.js
  2. 2
      apps/remix-ide/src/app/files/fileManager.js
  3. 5
      apps/remix-ide/src/app/ui/landing-page/landing-page.js
  4. 5
      libs/remix-ui/workspace/src/lib/actions/events.ts

@ -90,7 +90,10 @@ class DGitProvider extends Plugin {
...await this.getGitConfig(),
...cmd
})
await this.call('fileManager', 'refresh')
const self = this
setTimeout(async () => {
await self.call('fileManager', 'refresh')
}, 1000)
}
async rm (cmd) {
@ -98,7 +101,10 @@ class DGitProvider extends Plugin {
...await this.getGitConfig(),
...cmd
})
await this.call('fileManager', 'refresh')
const self = this
setTimeout(async () => {
await self.call('fileManager', 'refresh')
}, 1000)
}
async checkout (cmd) {
@ -106,7 +112,10 @@ class DGitProvider extends Plugin {
...await this.getGitConfig(),
...cmd
})
await this.call('fileManager', 'refresh')
const self = this
setTimeout(async () => {
await self.call('fileManager', 'refresh')
}, 1000)
}
async log (cmd) {
@ -131,7 +140,10 @@ class DGitProvider extends Plugin {
...await this.getGitConfig(),
...cmd
})
await this.call('fileManager', 'refresh')
const self = this
setTimeout(async () => {
await self.call('fileManager', 'refresh')
}, 1000)
return status
}
@ -239,7 +251,10 @@ class DGitProvider extends Plugin {
}
const result = await git.clone(cmd)
await this.call('fileManager', 'refresh')
const self = this
setTimeout(async () => {
await self.call('fileManager', 'refresh')
}, 1000)
return result
}
@ -272,7 +287,10 @@ class DGitProvider extends Plugin {
...await this.getGitConfig()
}
const result = await git.pull(cmd)
await this.call('fileManager', 'refresh')
const self = this
setTimeout(async () => {
await self.call('fileManager', 'refresh')
}, 1000)
return result
}
@ -289,7 +307,10 @@ class DGitProvider extends Plugin {
...await this.getGitConfig()
}
const result = await git.fetch(cmd)
await this.call('fileManager', 'refresh')
const self = this
setTimeout(async () => {
await self.call('fileManager', 'refresh')
}, 1000)
return result
}
@ -467,7 +488,10 @@ class DGitProvider extends Plugin {
} else {
result = await this.importIPFSFiles(this.remixIPFS, cid, workspace) || await this.importIPFSFiles(this.ipfsconfig, cid, workspace) || await this.importIPFSFiles(this.globalIPFSConfig, cid, workspace)
}
await this.call('fileManager', 'refresh')
const self = this
setTimeout(async () => {
await self.call('fileManager', 'refresh')
}, 1000)
if (!result) throw new Error(`Cannot pull files from IPFS at ${cid}`)
}

@ -139,7 +139,7 @@ class FileManager extends Plugin {
refresh () {
const provider = this.fileProviderOf('/')
// emit rootFolderChanged so that File Explorer reloads the file tree
provider.event.emit('rootFolderChanged', provider.workspace || '/')
this.emit('rootFolderChanged', provider.workspace || '/')
}
/**

@ -423,8 +423,9 @@ export class LandingPage extends ViewPlugin {
}
}
const setDemoFile = async () => {
await this.call('filePanel', 'createWorkspace', `workspace_${Date.now()}`, true)
await this.call('fileManager', 'setFile', 'tests/one/two/three/four/file.js', 'neihjiehjiheiheihiehiehiheiheihi')
// await this.call('filePanel', 'createWorkspace', `workspace_${Date.now()}`, true)
// await this.call('fileManager', 'setFile', 'tests/one/two/three/four/file.js', 'neihjiehjiheiheihiehiehiheiheihi')
await this.call('fileManager', 'refresh')
}
const onAcceptDownloadn = async () => {

@ -41,6 +41,10 @@ export const listenOnPluginEvents = (filePanelPlugin) => {
plugin.on('remixd', 'rootFolderChanged', async (path: string) => {
rootFolderChanged(path)
})
plugin.on('fileManager', 'rootFolderChanged', async (path: string) => {
rootFolderChanged(path)
})
}
export const listenOnProviderEvents = (provider) => (reducerDispatch: React.Dispatch<any>) => {
@ -182,5 +186,6 @@ const fileRenamed = async (oldPath: string) => {
}
const rootFolderChanged = async (path) => {
console.log('rootFolderChanged', path)
await dispatch(rootFolderChangedSuccess(path))
}

Loading…
Cancel
Save