Skip to content

Commit e0512f5

Browse files
author
Bot
committed
dereference codeInfo
1 parent b43623d commit e0512f5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/store/modules/misc.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,14 @@ const actions = {
4444
});
4545
},
4646
generateCodeInfo: ({ state, rootState, commit }, fileIndex) => {
47-
let codeInfo = { language: rootState.options.language }; // copy without reference
48-
delete codeInfo.files;
47+
// copy without reference and files
48+
let codeInfo = { language: {} };
49+
Object.keys(rootState.options.language)
50+
.filter((key) => key !== 'files')
51+
.forEach((key) => {
52+
codeInfo.language[key] = rootState.options.language[key];
53+
});
54+
4955

5056
if (fileIndex === -1) {
5157
codeInfo.tabSize = state.customCode.tabSize;

0 commit comments

Comments
 (0)