summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/ide/stores/mutations.js
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/ide/stores/mutations.js')
-rw-r--r--app/assets/javascripts/ide/stores/mutations.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/assets/javascripts/ide/stores/mutations.js b/app/assets/javascripts/ide/stores/mutations.js
index 5409ec1ec47..2a165f778ae 100644
--- a/app/assets/javascripts/ide/stores/mutations.js
+++ b/app/assets/javascripts/ide/stores/mutations.js
@@ -104,6 +104,21 @@ export default {
delayViewerUpdated,
});
},
+ [types.UPDATE_FILE_AFTER_COMMIT](state, { file, lastCommit }) {
+ const changedFile = state.changedFiles.find(f => f.path === file.path);
+
+ Object.assign(state.entries[file.path], {
+ raw: file.content,
+ changed: !!changedFile,
+ lastCommit: Object.assign(state.entries[file.path].lastCommit, {
+ id: lastCommit.commit.id,
+ url: lastCommit.commit_path,
+ message: lastCommit.commit.message,
+ author: lastCommit.commit.author_name,
+ updatedAt: lastCommit.commit.authored_date,
+ }),
+ });
+ },
...projectMutations,
...fileMutations,
...treeMutations,