修复决金箭bug
This commit is contained in:
@@ -165,12 +165,15 @@ export const getGameAPI = async (battleId) => {
|
||||
mode: battleStats.mode,
|
||||
gameMode: battleStats.gameMode,
|
||||
};
|
||||
if (battleStats.mode === 1) {
|
||||
if (battleStats && battleStats.mode === 1) {
|
||||
data.winner = battleStats.winner;
|
||||
data.roundsData = {};
|
||||
data.redPlayers = {};
|
||||
data.bluePlayers = {};
|
||||
data.goldenRound = goldenRoundRecords && goldenRoundRecords.length ? goldenRoundRecords[0] : null;
|
||||
data.goldenRound =
|
||||
goldenRoundRecords && goldenRoundRecords.length
|
||||
? goldenRoundRecords[0]
|
||||
: null;
|
||||
playerStats.forEach((item) => {
|
||||
const { playerBattleStats = {}, roundRecords = [] } = item;
|
||||
if (playerBattleStats.team === 0) {
|
||||
@@ -187,7 +190,7 @@ export const getGameAPI = async (battleId) => {
|
||||
});
|
||||
});
|
||||
}
|
||||
if (battleStats.mode === 2) {
|
||||
if (battleStats && battleStats.mode === 2) {
|
||||
data.players = [];
|
||||
playerStats.forEach((item) => {
|
||||
data.players.push({
|
||||
|
||||
Reference in New Issue
Block a user