+
+ We could not load recommendations right now. Try
+ again in a moment.
) : (
rec.sorts
.filter((a) => SORTS_ALLOWED_IDS.includes(a.topicId))
.map((sort, idx) => (
-
+ );
+}
diff --git a/components/providers/GameLaunchDialog.tsx b/components/providers/GameLaunchDialog.tsx
index 3d36e89..ffe7e9c 100644
--- a/components/providers/GameLaunchDialog.tsx
+++ b/components/providers/GameLaunchDialog.tsx
@@ -1,11 +1,15 @@
"use client";
import { useEffect, useState, useSyncExternalStore } from "react";
-import { closeGameLaunch, getGameLaunchState, subscribeGameLaunch } from "@/components/providers/game-launch-store";
+import {
+ closeGameLaunch,
+ getGameLaunchState,
+ subscribeGameLaunch
+} from "@/components/providers/game-launch-store";
+import { openDownloadDialog } from "@/components/providers/download-dialog-store";
import { Button } from "@/components/ui/button";
import { X } from "lucide-react";
import { RobloxLogoIcon } from "@/components/roblox/RobloxIcons";
-import Link from "next/link";
export function GameLaunchDialog() {
const state = useSyncExternalStore(
@@ -16,6 +20,34 @@ export function GameLaunchDialog() {
const [launchTimeouted, setLaunchTimeouted] = useState(false);
+ function detectOS() {
+ if (typeof navigator === "undefined") return "Unknown";
+ const nav = navigator as Navigator & {
+ userAgentData?: { platform?: string };
+ };
+ const platform = nav.userAgentData?.platform || nav.platform || "";
+ const ua = nav.userAgent || "";
+ const haystack = `${platform} ${ua}`;
+ if (/windows/i.test(haystack)) return "Windows";
+ if (/mac os x|macintosh|macos/i.test(haystack)) return "Mac";
+ if (/linux/i.test(haystack)) return "Linux";
+ return "Unknown";
+ }
+
+ function handleDownloadClick() {
+ const os = detectOS();
+ const canDownload = os === "Windows" || os === "Mac";
+ const url = canDownload
+ ? "https://www.roblox.com/download/client"
+ : null;
+ openDownloadDialog(url);
+ closeGameLaunch();
+ if (!canDownload || !url) return;
+ try {
+ window.open(url, "_blank", "noopener,noreferrer");
+ } catch {}
+ }
+
useEffect(() => {
if (!state.isOpen) {
setLaunchTimeouted(false);
@@ -33,7 +65,7 @@ export function GameLaunchDialog() {
return (
-
-
+
+
{!launchTimeouted ? (
<>
- Roblox is now loading. Get Ready!
+ Roblox is now loading.
+
+ Get ready!
>
) : (
- <>Download Roblox to play millions of experiences!>
+ <>
+ Download Roblox to play millions of
+ experiences.
+ >
)}