always use polling API for games to avoid 404s when game doesn't exist yet

This commit is contained in:
Jesse D. McDonald 2020-04-29 00:29:46 -05:00
parent bf301ad79a
commit 455e486075
1 changed files with 2 additions and 2 deletions

View File

@ -290,9 +290,9 @@ function startGamePoll(gameId, afterTime) {
const thisRequest = game.currentRequest = $.ajax({
dataType: 'json',
contentType: 'application/json',
url: `${API_BASE}/game/${gameId}${!afterTime ? '' : `/poll/${afterTime}`}`,
url: `${API_BASE}/game/${gameId}/poll/${afterTime || 0}`,
cache: false,
timeout: afterTime ? LONG_TIMEOUT : SHORT_TIMEOUT,
timeout: LONG_TIMEOUT,
}).done((data, textStatus, jqXHR) => {
if (game.currentRequest === thisRequest) {
game.currentRequest = null;