Skip to content

Commit

Permalink
weird bugfix for safari
Browse files Browse the repository at this point in the history
  • Loading branch information
thelamer committed Dec 7, 2021
1 parent 2ac417c commit 65c95d8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 12 deletions.
22 changes: 11 additions & 11 deletions frontend/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function launch(active_item) {
config.items['Disc ' + count.toString()].has_video = false;
config.items['Disc ' + count.toString()].multi_disc = 0;
};
rendermenu(config, 0);
rendermenu([config, 0]);
} else if (type == 'game') {
// Disable keyevents and hash watching
window.exit = false;
Expand Down Expand Up @@ -201,7 +201,9 @@ function launch(active_item) {
}

//// Page rendering logic ////
async function rendermenu(data, active_item) {
async function rendermenu(datas) {
var data = datas[0];
var active_item = datas[1];
// Set default variables
var portrait = window.orientation;
$('#menu').data('config', data);
Expand Down Expand Up @@ -410,13 +412,11 @@ async function rendermenu(data, active_item) {
};

// Load the json profile selected
function loadjson(name, active) {
var url = 'user/config/' + name + '.json';
fetch(url,Init)
.then((resp) => resp.json())
.then((data) => {
rendermenu(data, active)
});
async function loadjson(name, active_item) {
let url = 'user/config/' + name + '.json';
let response = await fetch(url,Init);
let data = await response.json();
rendermenu([data, active_item]);
}

window.onload = function() {
Expand All @@ -425,8 +425,8 @@ window.onload = function() {
} else {
var hash = window.location.hash.replace('#','');
var name = hash.split('---')[0];
var active = hash.split('---')[1];
loadjson(name, active);
let active_item = hash.split('---')[1];
loadjson(name, active_item);
}
$(window).on('hashchange', function() {
window.location.reload();
Expand Down
Loading

0 comments on commit 65c95d8

Please sign in to comment.