refs #4653 Fix reopening report modal

This commit is contained in:
AkiraFukushima 2024-01-15 00:39:42 +09:00
parent e4d05eeea3
commit 17d73bdf67
No known key found for this signature in database
GPG Key ID: B6E51BAC4DE1A957
1 changed files with 10 additions and 1 deletions

View File

@ -47,6 +47,15 @@ export default function Page() {
}
}, [router.query.modal, router.query.report_target_id])
const closeReport = () => {
setReport(null)
router.push({
query: Object.assign({}, router.query, {
report_target_id: null
})
})
}
if (!account || !client) return null
return (
<>
@ -56,7 +65,7 @@ export default function Page() {
<Timeline timeline={router.query.timeline as string} account={account} client={client} setAttachment={setAttachment} />
)}
<Media open={attachment !== null} close={() => setAttachment(null)} attachment={attachment} />
{report && <Report open={report !== null} close={() => setReport(null)} status={report} client={client} />}
{report && <Report open={report !== null} close={closeReport} status={report} client={client} />}
</>
)
}