Fix title for untitled auth parties
This commit is contained in:
parent
f2e281938a
commit
16c9446eb5
1 changed files with 3 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
import React, { useState } from 'react'
|
import React, { useState } from 'react'
|
||||||
import Head from 'next/head'
|
import Head from 'next/head'
|
||||||
|
import Router, { useRouter } from 'next/router'
|
||||||
import { useSnapshot } from 'valtio'
|
import { useSnapshot } from 'valtio'
|
||||||
import Linkify from 'react-linkify'
|
import Linkify from 'react-linkify'
|
||||||
import classNames from 'classnames'
|
import classNames from 'classnames'
|
||||||
|
|
@ -20,6 +21,7 @@ interface Props {
|
||||||
|
|
||||||
const PartyDetails = (props: Props) => {
|
const PartyDetails = (props: Props) => {
|
||||||
const { party, raids } = useSnapshot(appState)
|
const { party, raids } = useSnapshot(appState)
|
||||||
|
const router = useRouter()
|
||||||
|
|
||||||
const nameInput = React.createRef<HTMLInputElement>()
|
const nameInput = React.createRef<HTMLInputElement>()
|
||||||
const descriptionInput = React.createRef<HTMLTextAreaElement>()
|
const descriptionInput = React.createRef<HTMLTextAreaElement>()
|
||||||
|
|
@ -113,7 +115,7 @@ const PartyDetails = (props: Props) => {
|
||||||
|
|
||||||
if (party.name != null)
|
if (party.name != null)
|
||||||
title = `${party.name} by ${username}`
|
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"
|
title = "New Team"
|
||||||
else
|
else
|
||||||
title = `Untitled team by ${username}`
|
title = `Untitled team by ${username}`
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue