Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion frontend/src/console/views/Game.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -351,7 +354,7 @@ function handleAction(action: InputAction): boolean {
}

async function play() {
if (!rom.value) return;
if (!rom.value || isConsoleEmulationDisabled.value) return;

romApi
.updateUserRomProps({
Expand Down Expand Up @@ -633,7 +636,10 @@ 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>
Expand Down
11 changes: 11 additions & 0 deletions frontend/src/console/views/Play.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Comment thread
gantoine marked this conversation as resolved.
}

booted = true;
await boot();
detachKey = attachKeyboardExit();
Expand Down
Loading