Drop old purchase views and models
This commit is contained in:
@ -96,6 +96,17 @@ function renderGameDump(data) {
|
||||
renderPlayers(data.players);
|
||||
}
|
||||
|
||||
function playerReachedDestination(data) {
|
||||
console.log(data);
|
||||
|
||||
const dlgElement = document.getElementById("player-on-destination-modal");
|
||||
dlgElement.querySelector(".player-name").textContent = data.player.name;
|
||||
dlgElement.querySelector(".move-count").textContent = data.player.move_count;
|
||||
|
||||
const modal = new bootstrap.Modal(dlgElement);
|
||||
modal.show();
|
||||
}
|
||||
|
||||
function productPurchaseStart(products, purchaseTimeout) {
|
||||
console.log("productPurchaseStart:", products);
|
||||
const containerElement = document.getElementById("purchase-container");
|
||||
@ -149,6 +160,9 @@ function wsConnect() {
|
||||
case "game_dump":
|
||||
renderGameDump(wsMessage.data);
|
||||
break;
|
||||
case "player_on_destination":
|
||||
playerReachedDestination(wsMessage.data);
|
||||
break;
|
||||
case "product_purchase_start":
|
||||
productPurchaseStart(wsMessage.data.products, wsMessage.data.timeout);
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user