mirror of
https://github.com/rommapp/romm.git
synced 2026-11-28 17:48:31 +01:00
usePlatformPlayable is the platform-level twin of useCanPlay, but only the latter learned about js-dos, so win3x/win9x games offered Play while their platform tile showed no playable badge and sorted into the unplayable bucket. Teach resolveEmulator about js-dos and derive `playable`/`isPlayable` from it instead of hand-maintained OR chains. Collapse the duplication the new backend introduced: a shared resolvePlatformSlug in utils, a supportedBy factory for useCanPlay's three identical computeds, one COOP/COEP nginx pattern per map, and a single hard-navigation branch in useGameActions that reuses the canPlay useCanPlay already returns. In JsDos.vue, share the teardown tail between leavePlayer and onBeforeUnmount, collapse four derivations of the route rom id into one, start the js-dos runtime alongside the rom request rather than behind it, and hold the rom in a shallowRef since the view only reads scalars off it. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>