From c4b9a02a0f725b01a87a31a3f86e0e0aba9c8bf7 Mon Sep 17 00:00:00 2001 From: sdjdd Date: Mon, 13 Nov 2023 17:00:00 +0800 Subject: [PATCH] feat(next/web): display ticket title in document title --- next/web/src/App/Admin/Tickets/Ticket/TicketDetail.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/next/web/src/App/Admin/Tickets/Ticket/TicketDetail.tsx b/next/web/src/App/Admin/Tickets/Ticket/TicketDetail.tsx index d5923e3bc..80e91eaee 100644 --- a/next/web/src/App/Admin/Tickets/Ticket/TicketDetail.tsx +++ b/next/web/src/App/Admin/Tickets/Ticket/TicketDetail.tsx @@ -1,5 +1,6 @@ import { useMemo } from 'react'; import { useQueryClient } from 'react-query'; +import { useTitle } from 'react-use'; import { useNavigate, useParams } from 'react-router-dom'; import { AiFillExclamationCircle, AiOutlineApi } from 'react-icons/ai'; import moment from 'moment'; @@ -61,6 +62,9 @@ export function TicketDetail() { const navigate = useNavigate(); const { ticket, update, updating, refetch } = useMixedTicket(id); + useTitle(ticket ? ticket.title : 'Loading', { + restoreOnUnmount: true, + }); const { replies, fetchMoreReplies, refetchReples } = useTicketReplies(ticket?.id); const { opsLogs, fetchMoreOpsLogs } = useTicketOpsLogs(ticket?.id);