fix(console): honor DISABLE_EMULATOR_JS in console mode

Agent-Logs-Url: https://github.com/rommapp/romm/sessions/67bb960a-e5ec-4569-bdeb-d8c90028c004

Co-authored-by: gantoine <3247106+gantoine@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-05-14 18:40:25 +00:00
committed by GitHub
parent 5ed8fae4fc
commit 4ee310b0da
2 changed files with 17 additions and 1 deletions

View File

@@ -64,6 +64,9 @@ const descriptionOverlayRef = useTemplateRef<HTMLDivElement>(
"description-overlay-ref",
);
const detailsOverlayRef = useTemplateRef<HTMLDivElement>("details-overlay-ref");
const isConsoleEmulationDisabled = computed(
() => heartbeatStore.value.EMULATION.DISABLE_EMULATOR_JS,
);
const releaseDate = computed(() => {
if (!rom.value?.metadatum.first_release_date) return null;
@@ -351,7 +354,7 @@ function handleAction(action: InputAction): boolean {
}
async function play() {
if (!rom.value) return;
if (!rom.value || isConsoleEmulationDisabled.value) return;
romApi
.updateUserRomProps({
@@ -633,7 +636,9 @@ onUnmounted(() => {
:class="{
'scale-105 shadow-[0_8px_28px_rgba(0,0,0,0.35),_0_0_0_2px_var(--console-game-play-button-focus-border),_0_0_16px_var(--console-accent-secondary)]':
selectedZone === 'play',
'opacity-60 cursor-not-allowed': isConsoleEmulationDisabled,
}"
:disabled="isConsoleEmulationDisabled"
@click="play()"
>
<span class="text-lg md:text-xl"></span>

View File

@@ -26,6 +26,7 @@ import playSessionApi from "@/services/api/play-session";
import romApi from "@/services/api/rom";
import storeAuth from "@/stores/auth";
import storeConfig from "@/stores/config";
import storeHeartbeat from "@/stores/heartbeat";
import storeLanguage from "@/stores/language";
import type { DetailedRom } from "@/stores/roms";
import {
@@ -59,6 +60,7 @@ const router = useRouter();
const { getBezelImagePath } = useThemeAssets();
const authStore = storeAuth();
const configStore = storeConfig();
const heartbeatStore = storeHeartbeat();
const languageStore = storeLanguage();
const { selectedLanguage } = storeToRefs(languageStore);
const romId = Number(route.params.rom);
@@ -727,6 +729,15 @@ onMounted(async () => {
// Guard against duplicate mounts
if (booted) return;
if (heartbeatStore.value.EMULATION.DISABLE_EMULATOR_JS) {
await router.replace({
name: ROUTES.CONSOLE_ROM,
params: { rom: romId },
query: route.query,
});
return;
}
booted = true;
await boot();
detachKey = attachKeyboardExit();