Skip to content

Commit 7e86e7f

Browse files
committed
remove unused code
1 parent b0964cb commit 7e86e7f

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

app/src/helperFunctions/generateCode.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -271,21 +271,21 @@ const generateUnformattedCode = (
271271
const formatCode = (code: string) => {
272272
// in test environment, window.api is not defined,
273273
// so we reference original prettier format function instead
274-
// if (process.env.NODE_ENV === 'test') {
275-
// const { format } = require('prettier');
276-
// return format(code, {
277-
// singleQuote: true,
278-
// trailingComma: 'es5',
279-
// bracketSpacing: true,
280-
// jsxBracketSameLine: true,
281-
// parser: 'babel'
282-
// });
283-
// } else {
284-
// // console.log('prettier');
285-
// return window.api.formatCode(code);
286-
// }
274+
if (process.env.NODE_ENV === 'test') {
275+
const { format } = require('prettier');
276+
return format(code, {
277+
singleQuote: true,
278+
trailingComma: 'es5',
279+
bracketSpacing: true,
280+
jsxBracketSameLine: true,
281+
parser: 'babel'
282+
});
283+
} else {
284+
// console.log('prettier');
285+
return window.api.formatCode(code);
286+
}
287287
/* Error occured with "prettier" module despite reinstallation, for now formatCode returns the original codes without styling from prettier */
288-
return code;
288+
// return code;
289289
};
290290

291291
// generate code based on component hierarchy and then return the rendered code

app/src/reducers/componentReducer.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,6 @@ const reducer = (state: State, action: Action) => {
319319
};
320320
const nextChildId = state.nextChildId + 1;
321321
let nextTopSeparatorId = state.nextTopSeparatorId + 1;
322-
// let addChildArray = components[0].children;
323322
let addChildArray = components[canvasFocus.componentId-1].children
324323
addChildArray = manageSeparators.mergeSeparator(addChildArray, 1);
325324
if (directParent && directParent.name === 'separator') nextTopSeparatorId = manageSeparators.handleSeparators(addChildArray, 'add');

0 commit comments

Comments
 (0)