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,24 +80,24 @@ 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
.shareObject(
newScope(kind, key.toString()),
user.settings.email,
[
pond.Permission.PERMISSION_USERS,
pond.Permission.PERMISSION_READ,
pond.Permission.PERMISSION_WRITE,
pond.Permission.PERMISSION_SHARE
],
useImitation
.shareObject(
newScope(kind, key.toString()),
user.settings.email,
[
pond.Permission.PERMISSION_USERS,
pond.Permission.PERMISSION_READ,
pond.Permission.PERMISSION_WRITE,
pond.Permission.PERMISSION_SHARE
],
useImitation
)
.then((_response: any) => {
// history.push(url);
navigate(url)
dispatch({ key: "as", value: "" });
close();
})
.catch((_err: any) => {