Fixed save manager loading old version of save previously opened

This commit is contained in:
thepaperpilot 2022-04-24 14:37:26 -05:00
parent a46c973bad
commit b370d32797

View file

@ -61,15 +61,7 @@ import Modal from "components/Modal.vue";
import player, { PlayerData } from "game/player";
import settings from "game/settings";
import { getUniqueID, loadSave, save, newSave } from "util/save";
import {
ComponentPublicInstance,
computed,
nextTick,
ref,
shallowReactive,
unref,
watch
} from "vue";
import { ComponentPublicInstance, computed, nextTick, ref, shallowReactive, watch } from "vue";
import Select from "./fields/Select.vue";
import Text from "./fields/Text.vue";
import Save from "./Save.vue";
@ -207,6 +199,7 @@ function openSave(id: string) {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
saves.value[player.id]!.time = player.time;
save();
cachedSaves[player.id] = undefined;
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
loadSave(saves.value[id]!);
// Delete cached version in case of opening it again