Skip to content

Commit ea70764

Browse files
committed
Fix lack of automatic saving
1 parent f827acc commit ea70764

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

frontend/src/v2/views/Player/JsDos.vue

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ const playSession = usePlaySession();
2727
2828
const rom = ref<DetailedRom | null>(null);
2929
const gameRunning = ref(false);
30+
const quitting = ref(false);
3031
3132
type DosProps = {
3233
stop: () => Promise<void>;
@@ -150,7 +151,12 @@ async function stopDos() {
150151
}
151152
}
152153
153-
function onlyQuit() {
154+
async function onlyQuit() {
155+
if (quitting.value) return;
156+
quitting.value = true;
157+
playSession.flush();
158+
playingStore.setPlaying(false);
159+
await stopDos();
154160
window.history.back();
155161
}
156162
function backToRom() {
@@ -253,6 +259,8 @@ onBeforeUnmount(async () => {
253259
class="r-v2-jsdos__quit"
254260
variant="translucent"
255261
prepend-icon="mdi-exit-to-app"
262+
:loading="quitting"
263+
:disabled="quitting"
256264
@click="onlyQuit"
257265
>
258266
{{ t("play.quit") }}

0 commit comments

Comments
 (0)