Skip to content

Commit

Permalink
Fixing saved states names
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardozoppi committed Apr 10, 2024
1 parent e06c70b commit b268269
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions js/other/mobile.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,10 @@ document.addEventListener("visibilitychange", () => {
function refreshSavedGames(parent) {
const keys = listValues();
const items = keys.map(k => {
const name = k.substring("B64_SRAM_".length);
let name = k;
if (name.startsWith("B64_SRAM_")) {
name = k.substring("B64_".length);
}
const value = findValue(k);

const div = document.createElement("div");
Expand Down Expand Up @@ -161,7 +164,9 @@ function onLoad() {
loadInput.value = "";

if (file) {
loadSavedGame(`B64_SRAM_${removeExtension(file.name)}`, file);
let name = removeExtension(file.name);
if (name.startsWith("SRAM_")) name = `B64_${name}`;
loadSavedGame(name, file);
setTimeout(() => refreshSavedGames(recentGames), 1);
}
}
Expand Down

0 comments on commit b268269

Please sign in to comment.