添加游戏中途挂起,返回同步数据
This commit is contained in:
@@ -28,8 +28,18 @@ function createWebSocket(token, onMessage) {
|
||||
const msg = data.data.updates[0];
|
||||
if (!msg) return;
|
||||
if (msg.constructor === MESSAGETYPES.BackToGame) {
|
||||
const pages = getCurrentPages();
|
||||
const currentPage = pages[pages.length - 1];
|
||||
if (
|
||||
currentPage.route === "pages/battle-room" ||
|
||||
currentPage.route === "pages/team-match" ||
|
||||
currentPage.route === "pages/melee-match"
|
||||
) {
|
||||
return;
|
||||
}
|
||||
const { battleInfo } = msg;
|
||||
uni.setStorageSync("current-battle", battleInfo);
|
||||
console.log("----battleInfo", battleInfo);
|
||||
// 约战
|
||||
if (battleInfo.config.battleMode === 1) {
|
||||
uni.navigateTo({
|
||||
|
||||
Reference in New Issue
Block a user