Merge pull request #4779 from h3poteto/iss-4653/fix-report

refs #4653 Fix reopening report modal
This commit is contained in:
AkiraFukushima 2024-01-15 20:53:35 +09:00 committed by GitHub
commit 71982894c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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} />}
</>
)
}