Skip to content

Commit 906920d

Browse files
committed
follow-up vuejs port
1 parent b45d8dc commit 906920d

7 files changed

Lines changed: 38 additions & 6 deletions

File tree

favicon.svg

Lines changed: 1 addition & 0 deletions
Loading

icons.svg

Lines changed: 24 additions & 0 deletions
Loading

vue-app/public/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
<!-- Third-party libraries required by the app -->
99
<script src="third_party/protobuf.js"></script>
1010
<script src="third_party/protocol.js"></script>
11-
<script type="module" crossorigin src="./assets/index--krXkOx4.js"></script>
12-
<link rel="stylesheet" crossorigin href="./assets/index-CUQ1C1oo.css">
11+
<script type="module" crossorigin src="./assets/index-K4Pe1WJD.js"></script>
12+
<link rel="stylesheet" crossorigin href="./assets/index-BRZ2f-Ws.css">
1313
</head>
1414
<body>
1515
<div id="app"></div>

vue-app/src/components/PopupOverlay.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<div class="p-6 space-y-4">
99
<div class="text-pth-text text-sm" v-html="popup.message" />
1010
<div v-if="popup.type === 'loading' || popup.type === 'wait'" class="flex justify-center">
11-
<div class="w-8 h-8 border-4 border-pth-gold border-t-transparent rounded-full animate-spin" />
11+
<div class="w-8 h-8 border-4 border-pth-green border-t-transparent rounded-full animate-spin" />
1212
</div>
1313
<button
1414
v-if="popup.buttonText"

vue-app/src/services/netEventHandler.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,8 +283,9 @@ function handleMsgPlayerList(playerList) {
283283
if (playerList.playerListNotification === PlayerListNotification.playerListNew) {
284284
markInitialLobbyUpdateMsg()
285285
requestPlayerInfo(playerList.playerId)
286+
} else if (playerList.playerListNotification === PlayerListNotification.playerListLeft) {
287+
store.removePlayerData(playerList.playerId)
286288
}
287-
// playerListLeft handled reactively via store
288289
}
289290

290291
function handleMsgPlayerInfoReply(playerInfoReply) {

vue-app/src/stores/gameCacheStore.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ export const useGameCacheStore = defineStore('gameCache', () => {
125125
return playerDataMap[pid]
126126
}
127127

128+
function removePlayerData(pid) {
129+
delete playerDataMap[pid]
130+
}
131+
128132
function hasPlayerData(pid) {
129133
return pid in playerDataMap && playerDataMap[pid]?.playerInfoData !== undefined
130134
}
@@ -333,6 +337,7 @@ export const useGameCacheStore = defineStore('gameCache', () => {
333337
// Player data
334338
addPlayerData,
335339
getPlayerData,
340+
removePlayerData,
336341
hasPlayerData,
337342
hasPlayerCards,
338343
setPlayerResult,

vue-app/vite.config.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ import { fileURLToPath, URL } from 'node:url'
55
// https://vite.dev/config/
66
export default defineConfig({
77
base: './',
8-
publicDir: 'static',
8+
publicDir: false,
99
build: {
10-
outDir: 'public',
10+
outDir: '../',
11+
emptyOutDir: false,
1112
},
1213
plugins: [vue()],
1314
resolve: {

0 commit comments

Comments
 (0)