some roblox stuff again

This commit is contained in:
2025-07-24 04:25:18 +03:00
parent e0217cbbcb
commit d1f925f298
35 changed files with 866 additions and 282 deletions

View File

@@ -58,7 +58,7 @@ export type OmniRecommendation = {
sorts: RecommendationSort[];
};
export async function getOmniRecommendationsHome(): Promise<OmniRecommendation> {
export async function getOmniRecommendationsHome(): Promise<OmniRecommendation | null> {
const data = await proxyFetch(
`https://apis.roblox.com/discovery-api/omni-recommendation`,
{
@@ -77,7 +77,11 @@ export async function getOmniRecommendationsHome(): Promise<OmniRecommendation>
}
}
);
return (await data.json()) as OmniRecommendation;
const J = await data.json();
if (J.errors) {
return null;
}
return J as OmniRecommendation;
}
// https://apis.roblox.com/discovery-api/omni-recommendation

View File

@@ -1,3 +1,5 @@
"use client";
import { proxyFetch } from "./utils";
export type UserProfileDetails = {
@@ -15,7 +17,7 @@ export async function getLoggedInUser(): Promise<{
id: number;
name: string;
displayName: string;
}> {
} | null> {
const data = await proxyFetch(
`https://users.roblox.com/v1/users/authenticated`,
{
@@ -25,7 +27,11 @@ export async function getLoggedInUser(): Promise<{
}
}
);
return (await data.json()) as any as {
const J = await data.json();
if (J.errors) {
return null;
}
return J as any as {
id: number;
name: string;
displayName: string;

View File

@@ -1,3 +1,5 @@
"use client";
import { clsx, type ClassValue } from "clsx";
import { twMerge } from "tailwind-merge";