From ae45b29e933d57e4f53001a6f8203b933c732871 Mon Sep 17 00:00:00 2001 From: Katalina Okano Date: Mon, 22 May 2023 11:32:45 -0400 Subject: [PATCH] handle incorrect world in meta --- app/routes/worlds.$id.tsx | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/app/routes/worlds.$id.tsx b/app/routes/worlds.$id.tsx index b406b73..da3fe4e 100644 --- a/app/routes/worlds.$id.tsx +++ b/app/routes/worlds.$id.tsx @@ -1,13 +1,8 @@ import type { LoaderArgs, V2_MetaFunction } from "@remix-run/cloudflare"; import { json } from "@remix-run/cloudflare"; import { useLoaderData } from "@remix-run/react"; -import { - WorldResponse, - Zone, - allClasses, - allVehicles, - worldQuery, -} from "~/utils/saerro"; +import type { WorldResponse, Zone } from "~/utils/saerro"; +import { allClasses, allVehicles, worldQuery } from "~/utils/saerro"; import { pascalCaseToTitleCase, toTitleCase } from "~/utils/strings"; export const loader = async ({ params }: LoaderArgs) => { @@ -15,7 +10,7 @@ export const loader = async ({ params }: LoaderArgs) => { }; export const meta: V2_MetaFunction = ({ data }) => { - return [{ title: `${data.world.name} | PS2.LIVE` }]; + return [{ title: `${data?.world.name || "Unknown world"} | PS2.LIVE` }]; }; export default function World() {