|
|
@ -182,7 +182,8 @@ export const fileRenamedSuccess = (path: string, removePath: string, files) => { |
|
|
|
export const init = (provider, workspaceName: string, plugin, registry) => (dispatch: React.Dispatch<any>) => { |
|
|
|
export const init = (provider, workspaceName: string, plugin, registry) => (dispatch: React.Dispatch<any>) => { |
|
|
|
if (provider) { |
|
|
|
if (provider) { |
|
|
|
provider.event.register('fileAdded', async (filePath) => { |
|
|
|
provider.event.register('fileAdded', async (filePath) => { |
|
|
|
const path = extractParentFromKey(filePath) ? extractParentFromKey(filePath) === '/.workspaces' ? workspaceName : extractParentFromKey(filePath) : workspaceName |
|
|
|
if (extractParentFromKey(filePath) === '/.workspaces') return |
|
|
|
|
|
|
|
const path = extractParentFromKey(filePath) || workspaceName |
|
|
|
const data = await fetchDirectoryContent(provider, path) |
|
|
|
const data = await fetchDirectoryContent(provider, path) |
|
|
|
|
|
|
|
|
|
|
|
dispatch(fileAddedSuccess(path, data)) |
|
|
|
dispatch(fileAddedSuccess(path, data)) |
|
|
@ -191,7 +192,8 @@ export const init = (provider, workspaceName: string, plugin, registry) => (disp |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
provider.event.register('folderAdded', async (folderPath) => { |
|
|
|
provider.event.register('folderAdded', async (folderPath) => { |
|
|
|
const path = extractParentFromKey(folderPath) ? extractParentFromKey(folderPath) === '/.workspaces' ? workspaceName : extractParentFromKey(folderPath) : workspaceName |
|
|
|
if (extractParentFromKey(folderPath) === '/.workspaces') return |
|
|
|
|
|
|
|
const path = extractParentFromKey(folderPath) || workspaceName |
|
|
|
const data = await fetchDirectoryContent(provider, path) |
|
|
|
const data = await fetchDirectoryContent(provider, path) |
|
|
|
|
|
|
|
|
|
|
|
dispatch(folderAddedSuccess(path, data)) |
|
|
|
dispatch(folderAddedSuccess(path, data)) |
|
|
|