Skip to content

Commit cc63717

Browse files
authored
Resolved Issue no #934
1 parent a948256 commit cc63717

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

client/modules/IDE/components/Console.jsx

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,24 @@ const Console = ({ t }) => {
114114
const isExpanded = useSelector((state) => state.ide.consoleIsExpanded);
115115
const isPlaying = useSelector((state) => state.ide.isPlaying);
116116
const { theme, fontSize } = useSelector((state) => state.preferences);
117-
117+
const dataCompare = (data1, data2) => {
118+
if (data1.length !== data2.length) {
119+
return false;
120+
}
121+
for (let i = 0; i < data1.length; i += 1) {
122+
if (data1[i] !== data2[i]) {
123+
return false;
124+
}
125+
}
126+
return true;
127+
};
128+
for (let i = 1; i < consoleEvents.length; i += 1) {
129+
if (dataCompare(consoleEvents[i].data, consoleEvents[i - 1].data)) {
130+
consoleEvents[i - 1].times += consoleEvents[i].times;
131+
consoleEvents.splice(i, 1);
132+
i -= 1;
133+
}
134+
}
118135
const {
119136
collapseConsole,
120137
expandConsole,

0 commit comments

Comments
 (0)