File tree Expand file tree Collapse file tree
frontend/src/v2/views/Player Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ const playSession = usePlaySession();
2727
2828const rom = ref <DetailedRom | null >(null );
2929const gameRunning = ref (false );
30+ const quitting = ref (false );
3031
3132type 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}
156162function 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") }}
You can’t perform that action at this time.
0 commit comments