update:新增匹配跳转幂等
This commit is contained in:
@@ -4,10 +4,12 @@ function getMatchId(battleInfo) {
|
||||
return battleInfo?.matchId || battleInfo?.id || "";
|
||||
}
|
||||
|
||||
function getBattlePageUrl(battleInfo) {
|
||||
return Number(battleInfo?.mode) <= 3
|
||||
? "/pages/team-battle/index?fromReturn=1"
|
||||
: "/pages/melee-battle?fromReturn=1";
|
||||
function getBattlePageUrl(battleInfo, matchId) {
|
||||
const page =
|
||||
Number(battleInfo?.mode) <= 3
|
||||
? "/pages/team-battle/index"
|
||||
: "/pages/melee-battle";
|
||||
return `${page}?fromReturn=1&battleId=${encodeURIComponent(String(matchId))}`;
|
||||
}
|
||||
|
||||
export function takeMatchReturnSnapshot() {
|
||||
@@ -27,6 +29,6 @@ export async function returnToBattle(battleInfo, navigate) {
|
||||
}
|
||||
|
||||
uni.setStorageSync(MATCH_RETURN_SNAPSHOT_KEY, battleInfo);
|
||||
await navigate(getBattlePageUrl(battleInfo));
|
||||
await navigate(getBattlePageUrl(battleInfo, matchId));
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user