Fix closing the help dialog not changing the URL

This commit is contained in:
Andrio Celos
2023-02-23 11:10:06 +11:00
parent 14b1b1a623
commit d2712f8e2c

View File

@@ -170,6 +170,18 @@ preGameHelpButton.addEventListener('click', e => {
setUrl('help');
});
helpDialog.addEventListener('close', () => {
if (canPushState) {
try {
history.pushState(null, '', '.');
} catch {
canPushState = false;
}
}
if (location.hash)
location.hash = '';
});
preGameReplayButton.addEventListener('click', e => {
e.preventDefault();