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

This commit is contained in:
Nya Candy
2023-05-09 13:50:52 +01:00
committed by GitHub
parent a9d3404642
commit 75a7f12803
@@ -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)
}