fix: redirect permission issue after change handle (#507)

This commit is contained in:
Nya Candy 2023-05-09 20:50:52 +08:00 committed by GitHub
parent a9d3404642
commit 75a7f12803
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 5 deletions

View File

@ -68,11 +68,16 @@ export default function SettingsDomainsPage() {
if (updateSite.isSuccess) {
if (updateSite.data?.code === 0) {
toast.success("Saved!")
router.replace(
`/dashboard/${
updateSite.variables?.subdomain || updateSite.variables?.site
}/settings/domains`,
)
useAccountState
.getState()
.refresh()
.then(() => {
router.replace(
`/dashboard/${
updateSite.variables?.subdomain || updateSite.variables?.site
}/settings/domains`,
)
})
} else {
toast.error("Failed to update site" + ": " + updateSite.data.message)
}