moved the dispatch call to change as to be after the navigation
This commit is contained in:
parent
2c2fda4817
commit
a7ed8ccb21
1 changed files with 11 additions and 11 deletions
|
|
@ -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) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue