moved the dispatch call to change as to be after the navigation

This commit is contained in:
csawatzky 2025-05-15 14:37:20 -06:00
parent 2c2fda4817
commit a7ed8ccb21

View file

@ -80,7 +80,6 @@ export default function AccessObject(props: Props) {
const getAccess = (key: number | string, name: string, url: string, useImitation = false) => {
user.settings.useTeam = false;
dispatch({ key: "as", value: "" });
userAPI.updateUser(user.id(), user.protobuf()).then(() => {
info("Will no longer view as team by default");
permissionAPI
@ -98,6 +97,7 @@ export default function AccessObject(props: Props) {
.then((_response: any) => {
// history.push(url);
navigate(url)
dispatch({ key: "as", value: "" });
close();
})
.catch((_err: any) => {