add a beforeunload event to exiting the game launcher to ensure srm files are generated

This commit is contained in:
thelamer 2021-10-23 11:51:32 -07:00
parent 2880a36a3e
commit fbf5bc62e6
2 changed files with 4 additions and 3 deletions

View File

@ -140,9 +140,10 @@ function launch(active_item) {
}
}, 100);
// Reload window if user clicks back
$(window).on('hashchange', function() {
$(window).on('hashchange', async function() {
if (window.location.hash !== '#game') {
window.location.reload();
window.dispatchEvent(new Event('beforeunload'));
setTimeout(function(){window.location.reload();}, 1000);
}
});
}

View File

@ -1,6 +1,6 @@
{
"name": "emulatorjs",
"version": "0.0.1",
"version": "0.0.2",
"description": "Rom and art management utility for generating configuration files for use with the EmulatorJS frontend",
"main": "index.js",
"author": "thelamer",