Commit f39dc0ea authored by Phil Hughes's avatar Phil Hughes

Fixed loading state not showing in IDE tree list

parent a56611e3
...@@ -17,12 +17,8 @@ export default { ...@@ -17,12 +17,8 @@ export default {
}); });
}, },
[types.SET_DIRECTORY_DATA](state, { data, treePath }) { [types.SET_DIRECTORY_DATA](state, { data, treePath }) {
Object.assign(state, { Object.assign(state.trees[treePath], {
trees: Object.assign(state.trees, {
[treePath]: {
tree: data, tree: data,
},
}),
}); });
}, },
[types.SET_LAST_COMMIT_URL](state, { tree = state, url }) { [types.SET_LAST_COMMIT_URL](state, { tree = state, url }) {
......
---
title: Fixed IDE not showing loading state when tree is loading
merge_request:
author:
type: fixed
...@@ -55,6 +55,16 @@ describe('Multi-file store tree mutations', () => { ...@@ -55,6 +55,16 @@ describe('Multi-file store tree mutations', () => {
expect(tree.tree[1].name).toBe('submodule'); expect(tree.tree[1].name).toBe('submodule');
expect(tree.tree[2].name).toBe('blob'); expect(tree.tree[2].name).toBe('blob');
}); });
it('keeps loading state', () => {
mutations.CREATE_TREE(localState, { treePath: 'project/master' });
mutations.SET_DIRECTORY_DATA(localState, {
data,
treePath: 'project/master',
});
expect(localState.trees['project/master'].loading).toBe(true);
});
}); });
describe('REMOVE_ALL_CHANGES_FILES', () => { describe('REMOVE_ALL_CHANGES_FILES', () => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment