Spaces:
Sleeping
Sleeping
Commit
·
49798bd
1
Parent(s):
b78e8db
fix: fall back to initializeGame when TGN loading fails
Browse filesWhen gameReset event has TGN but parsing fails, now properly falls
back to initializeGame() with the server's boardShape.
Co-Authored-By: Claude <noreply@anthropic.com>
trigo-web/app/dist/assets/{index-LYvExrie.js → index-BMzK2esc.js}
RENAMED
|
The diff for this file is too large to render.
See raw diff
|
|
|
trigo-web/app/dist/index.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
| 5 |
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 7 |
<title>Trigo - 3D Go Game</title>
|
| 8 |
-
<script type="module" crossorigin src="/assets/index-
|
| 9 |
<link rel="stylesheet" crossorigin href="/assets/index-Siwlapuk.css">
|
| 10 |
</head>
|
| 11 |
<body>
|
|
|
|
| 5 |
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
| 6 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
| 7 |
<title>Trigo - 3D Go Game</title>
|
| 8 |
+
<script type="module" crossorigin src="/assets/index-BMzK2esc.js"></script>
|
| 9 |
<link rel="stylesheet" crossorigin href="/assets/index-Siwlapuk.css">
|
| 10 |
</head>
|
| 11 |
<body>
|
trigo-web/app/src/views/TrigoView.vue
CHANGED
|
@@ -1506,11 +1506,14 @@
|
|
| 1506 |
// Get the new board shape from server, or use current
|
| 1507 |
const newBoardShape = data.boardShape || boardShape.value;
|
| 1508 |
|
| 1509 |
-
// Reload game state
|
|
|
|
| 1510 |
if (data.tgn) {
|
| 1511 |
-
gameStore.loadFromTGN(data.tgn);
|
| 1512 |
-
}
|
| 1513 |
-
|
|
|
|
|
|
|
| 1514 |
gameStore.initializeGame(newBoardShape);
|
| 1515 |
gameStore.startGame();
|
| 1516 |
}
|
|
|
|
| 1506 |
// Get the new board shape from server, or use current
|
| 1507 |
const newBoardShape = data.boardShape || boardShape.value;
|
| 1508 |
|
| 1509 |
+
// Reload game state - try TGN first, fall back to initializeGame
|
| 1510 |
+
let loaded = false;
|
| 1511 |
if (data.tgn) {
|
| 1512 |
+
loaded = gameStore.loadFromTGN(data.tgn);
|
| 1513 |
+
}
|
| 1514 |
+
|
| 1515 |
+
// If TGN loading failed or no TGN, use initializeGame with new board shape
|
| 1516 |
+
if (!loaded) {
|
| 1517 |
gameStore.initializeGame(newBoardShape);
|
| 1518 |
gameStore.startGame();
|
| 1519 |
}
|