fix "new game" button with rating range

This commit is contained in:
Thibault Duplessis 2020-09-22 11:25:12 +02:00
parent f017c6dec6
commit 299a2d1232
2 changed files with 3 additions and 1 deletions

View file

@ -63,8 +63,9 @@ export default function LichessLobby(opts: LobbyOpts) {
lichess.StrongSocket.firstConnect.then(() => { lichess.StrongSocket.firstConnect.then(() => {
const gameId = getParameterByName('hook_like'); const gameId = getParameterByName('hook_like');
if (!gameId) return; if (!gameId) return;
const ratingRange = lobby.setup.stores.hook.get()?.ratingRange;
xhr.text( xhr.text(
`/setup/hook/${lichess.sri}/like/${gameId}?rr=${lobby.setup.ratingRange() || ''}`, `/setup/hook/${lichess.sri}/like/${gameId}?rr=${ratingRange || ''}`,
{ method: 'post' }); { method: 'post' });
lobby.setTab('real_time'); lobby.setTab('real_time');
history.replaceState(null, '', '/'); history.replaceState(null, '', '/');

View file

@ -203,6 +203,7 @@ export default class Setup {
rating + parseInt(form.ratingRange_range_min.value), rating + parseInt(form.ratingRange_range_min.value),
rating + parseInt(form.ratingRange_range_max.value) rating + parseInt(form.ratingRange_range_max.value)
].join('-'); ].join('-');
save();
const poolMember = this.hookToPoolMember(color, form); const poolMember = this.hookToPoolMember(color, form);
modal.close(); modal.close();
if (poolMember) { if (poolMember) {