Fix title for untitled auth parties

This commit is contained in:
Justin Edmund 2022-03-04 16:03:15 -08:00
parent f2e281938a
commit 16c9446eb5

View file

@ -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<HTMLInputElement>()
const descriptionInput = React.createRef<HTMLTextAreaElement>()
@ -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}`