|
|
@ -184,7 +184,7 @@ export const browserReducer = (state = browserInitialState, action: Actions) => |
|
|
|
|
|
|
|
|
|
|
|
case 'FETCH_DIRECTORY_SUCCESS': { |
|
|
|
case 'FETCH_DIRECTORY_SUCCESS': { |
|
|
|
const payload = action.payload |
|
|
|
const payload = action.payload |
|
|
|
console.log('make a flat tree', payload) |
|
|
|
console.log('FETCH_DIRECTORY_SUCCESS', payload) |
|
|
|
const startTime = new Date().getTime() |
|
|
|
const startTime = new Date().getTime() |
|
|
|
const fd = fetchDirectoryContent(state, payload) |
|
|
|
const fd = fetchDirectoryContent(state, payload) |
|
|
|
const endTime = new Date().getTime() |
|
|
|
const endTime = new Date().getTime() |
|
|
@ -255,16 +255,11 @@ export const browserReducer = (state = browserInitialState, action: Actions) => |
|
|
|
case 'FETCH_WORKSPACE_DIRECTORY_SUCCESS': { |
|
|
|
case 'FETCH_WORKSPACE_DIRECTORY_SUCCESS': { |
|
|
|
const payload = action.payload |
|
|
|
const payload = action.payload |
|
|
|
if(state.mode === 'browser'){ |
|
|
|
if(state.mode === 'browser'){ |
|
|
|
console.log('make a flat tree', payload) |
|
|
|
console.log('FETCH_WORKSPACE_DIRECTORY_SUCCESS', payload) |
|
|
|
} |
|
|
|
} |
|
|
|
const startTime = new Date().getTime() |
|
|
|
const startTime = new Date().getTime() |
|
|
|
const fd = fetchWorkspaceDirectoryContent(state, payload) |
|
|
|
const fd = fetchWorkspaceDirectoryContent(state, payload) |
|
|
|
const endTime = new Date().getTime() |
|
|
|
const endTime = new Date().getTime() |
|
|
|
|
|
|
|
|
|
|
|
console.log(fd[payload.path]) |
|
|
|
|
|
|
|
const sortedKeys = fileKeySort(fd[payload.path]) |
|
|
|
|
|
|
|
console.log('sortedKeys', sortedKeys) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
console.log('fetchDirectoryContent tree', endTime - startTime, fd) |
|
|
|
console.log('fetchDirectoryContent tree', endTime - startTime, fd) |
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
return { |
|
|
@ -957,6 +952,7 @@ const fetchDirectoryContent = ( |
|
|
|
return state.mode === 'browser' |
|
|
|
return state.mode === 'browser' |
|
|
|
? state.browser.files |
|
|
|
? state.browser.files |
|
|
|
: state[state.mode].files |
|
|
|
: state[state.mode].files |
|
|
|
|
|
|
|
fileKeySort(payload.fileTree) |
|
|
|
if (state.mode === 'browser') { |
|
|
|
if (state.mode === 'browser') { |
|
|
|
if (payload.path === ROOT_PATH) { |
|
|
|
if (payload.path === ROOT_PATH) { |
|
|
|
let files = normalize(payload.fileTree, ROOT_PATH, payload.type) |
|
|
|
let files = normalize(payload.fileTree, ROOT_PATH, payload.type) |
|
|
|