always use polling API for games to avoid 404s when game doesn't exist yet
This commit is contained in:
parent
bf301ad79a
commit
455e486075
|
|
@ -290,9 +290,9 @@ function startGamePoll(gameId, afterTime) {
|
||||||
const thisRequest = game.currentRequest = $.ajax({
|
const thisRequest = game.currentRequest = $.ajax({
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
contentType: 'application/json',
|
contentType: 'application/json',
|
||||||
url: `${API_BASE}/game/${gameId}${!afterTime ? '' : `/poll/${afterTime}`}`,
|
url: `${API_BASE}/game/${gameId}/poll/${afterTime || 0}`,
|
||||||
cache: false,
|
cache: false,
|
||||||
timeout: afterTime ? LONG_TIMEOUT : SHORT_TIMEOUT,
|
timeout: LONG_TIMEOUT,
|
||||||
}).done((data, textStatus, jqXHR) => {
|
}).done((data, textStatus, jqXHR) => {
|
||||||
if (game.currentRequest === thisRequest) {
|
if (game.currentRequest === thisRequest) {
|
||||||
game.currentRequest = null;
|
game.currentRequest = null;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue