From 16c9446eb55a0aa404567a840429248bc3359212 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Fri, 4 Mar 2022 16:03:15 -0800 Subject: [PATCH] Fix title for untitled auth parties --- components/PartyDetails/index.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/PartyDetails/index.tsx b/components/PartyDetails/index.tsx index 2cf0af1f..4c0f8186 100644 --- a/components/PartyDetails/index.tsx +++ b/components/PartyDetails/index.tsx @@ -1,5 +1,6 @@ import React, { useState } from 'react' import Head from 'next/head' +import Router, { useRouter } from 'next/router' import { useSnapshot } from 'valtio' import Linkify from 'react-linkify' import classNames from 'classnames' @@ -20,6 +21,7 @@ interface Props { const PartyDetails = (props: Props) => { const { party, raids } = useSnapshot(appState) + const router = useRouter() const nameInput = React.createRef() const descriptionInput = React.createRef() @@ -113,7 +115,7 @@ const PartyDetails = (props: Props) => { if (party.name != null) title = `${party.name} by ${username}` - else if (party.name == null && party.editable) + else if (party.name == null && party.editable && router.route === '/new') title = "New Team" else title = `Untitled team by ${username}`