|
|
@@ -360,8 +360,11 @@ const solutionsCleanup = () => {
|
|
|
}
|
|
|
|
|
|
const getTotalProfit = (sid1, sid2, gold_side_jc) => {
|
|
|
- const sol1 = GAMES.Solutions[sid1];
|
|
|
- const sol2 = GAMES.Solutions[sid2];
|
|
|
+ const sol1 = GAMES.Solutions[sid1]?.sol;
|
|
|
+ const sol2 = GAMES.Solutions[sid2]?.sol;
|
|
|
+ if (!sol1 || !sol2 || !gold_side_jc) {
|
|
|
+ return {};
|
|
|
+ }
|
|
|
return calcTotalProfit(sol1, sol2, gold_side_jc);
|
|
|
}
|
|
|
|
|
|
@@ -379,9 +382,9 @@ events_child.on('message', async (message) => {
|
|
|
if (type == 'getGamesRelation') {
|
|
|
responseData = await getGamesRelation(true);
|
|
|
}
|
|
|
- else if (type == 'getSolutionHistory') {
|
|
|
- responseData = getSolutionHistory();
|
|
|
- }
|
|
|
+ // else if (type == 'getSolutionHistory') {
|
|
|
+ // responseData = getSolutionHistory();
|
|
|
+ // }
|
|
|
events_child.send({ type: 'response', id, data: responseData });
|
|
|
}
|
|
|
else if (method == 'post') {
|