diff --git a/app/assets/javascripts/ide/components/repo_editor.vue b/app/assets/javascripts/ide/components/repo_editor.vue index c4dd29f51926e344cdeba857ff1e90fd4bf7c7d8..b1a16350c19ffb1201b805db90be66924d205a97 100644 --- a/app/assets/javascripts/ide/components/repo_editor.vue +++ b/app/assets/javascripts/ide/components/repo_editor.vue @@ -71,7 +71,7 @@ export default { }) .then(() => { const viewerPromise = this.delayViewerUpdated - ? this.updateViewer('editor') + ? this.updateViewer(this.file.pending ? 'diff' : 'editor') : Promise.resolve(); return viewerPromise; diff --git a/app/assets/javascripts/ide/stores/modules/commit/getters.js b/app/assets/javascripts/ide/stores/modules/commit/getters.js index f6d60e1848f5df85141f8c8c050d115d4b11e141..375f9eb2f7c3f2220cc879b4a5b43af212490228 100644 --- a/app/assets/javascripts/ide/stores/modules/commit/getters.js +++ b/app/assets/javascripts/ide/stores/modules/commit/getters.js @@ -7,9 +7,9 @@ export const commitButtonDisabled = (state, getters, rootState) => getters.discardDraftButtonDisabled || !rootState.stagedFiles.length; export const newBranchName = (state, _, rootState) => - `${gon.current_username}-${ - rootState.currentBranchId - }-patch-${`${new Date().getTime()}`.substr(-5)}`; + `${gon.current_username}-${rootState.currentBranchId}-patch-${`${new Date().getTime()}`.substr( + -5, + )}`; export const branchName = (state, getters, rootState) => { if ( diff --git a/app/assets/javascripts/ide/stores/mutations/file.js b/app/assets/javascripts/ide/stores/mutations/file.js index 5549d601603f3eef5667b000f1ae8d38d2b9a544..7eccc2c82cfad190ea9e14cd7ddb9d3b05098b82 100644 --- a/app/assets/javascripts/ide/stores/mutations/file.js +++ b/app/assets/javascripts/ide/stores/mutations/file.js @@ -131,6 +131,7 @@ export default { if (!changedFile && stagedFile) { Object.assign(state.entries[path], { ...stagedFile, + key: state.entries[path].key, changed: true, }); diff --git a/app/assets/javascripts/ide/stores/utils.js b/app/assets/javascripts/ide/stores/utils.js index 597fa3a1c10b6cce39319319c2ee9e0da0770a16..00686bdadce92bd75421c519f7d956369ee8009e 100644 --- a/app/assets/javascripts/ide/stores/utils.js +++ b/app/assets/javascripts/ide/stores/utils.js @@ -88,8 +88,7 @@ export const decorateData = entity => { export const findEntry = (tree, type, name, prop = 'name') => tree.find(f => f.type === type && f[prop] === name); -export const findIndexOfFile = (state, file) => - state.findIndex(f => f.path === file.path); +export const findIndexOfFile = (state, file) => state.findIndex(f => f.path === file.path); export const setPageTitle = title => { document.title = title;