Commit 2aaa0222 authored by Phil Hughes's avatar Phil Hughes

fixed delayed update viewer

fixed `key` not being set to correct value
parent b61aa6f8
......@@ -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;
......
......@@ -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 (
......
......@@ -131,6 +131,7 @@ export default {
if (!changedFile && stagedFile) {
Object.assign(state.entries[path], {
...stagedFile,
key: state.entries[path].key,
changed: true,
});
......
......@@ -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;
......
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