forked from github/plane
fix: exception error (#2606)
* fix: exception error * fix: invitation type
This commit is contained in:
parent
2cda47dc8a
commit
5b808571e5
@ -31,13 +31,6 @@ export const ProjectMemberList: React.FC = observer(() => {
|
||||
|
||||
const { user } = useUser();
|
||||
|
||||
useSWR(
|
||||
workspaceSlug && projectId ? `PROJECT_MEMBERS_${projectId.toString().toUpperCase()}` : null,
|
||||
workspaceSlug && projectId
|
||||
? () => projectStore.fetchProjectMembers(workspaceSlug.toString(), projectId.toString())
|
||||
: null
|
||||
);
|
||||
|
||||
const { data: projectInvitations } = useSWR(
|
||||
workspaceSlug && projectId ? `PROJECT_INVITATIONS_${projectId.toString()}` : null,
|
||||
workspaceSlug && projectId
|
||||
|
@ -102,7 +102,7 @@ export class ProjectLabelStore implements IProjectLabelStore {
|
||||
[projectId]: (this.rootStore.project.labels?.[projectId] || [])?.map((label) =>
|
||||
label.id === labelId ? { ...label, ...originalLabel } : label
|
||||
),
|
||||
} as any;
|
||||
};
|
||||
});
|
||||
throw error;
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ export class ProjectStateStore implements IProjectStateStore {
|
||||
};
|
||||
|
||||
updateState = async (workspaceSlug: string, projectId: string, stateId: string, data: Partial<IState>) => {
|
||||
const originalStates = this.rootStore.project.states;
|
||||
const originalStates = this.rootStore.project.states || {};
|
||||
|
||||
runInAction(() => {
|
||||
this.rootStore.project.states = {
|
||||
@ -120,13 +120,7 @@ export class ProjectStateStore implements IProjectStateStore {
|
||||
} catch (error) {
|
||||
console.log("Failed to update state from project store");
|
||||
runInAction(() => {
|
||||
this.rootStore.project.states = {
|
||||
...this.rootStore.project.states,
|
||||
[projectId]: {
|
||||
...this.rootStore.project.states?.[projectId],
|
||||
[data.group as string]: originalStates || [],
|
||||
},
|
||||
} as any;
|
||||
this.rootStore.project.states = originalStates;
|
||||
});
|
||||
throw error;
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ class UserStore implements IUserStore {
|
||||
|
||||
get currentWorkspaceRole() {
|
||||
if (!this.rootStore.workspace.workspaceSlug) return;
|
||||
return this.workspaceMemberInfo[this.rootStore.workspace.workspaceSlug].role;
|
||||
return this.workspaceMemberInfo[this.rootStore.workspace.workspaceSlug]?.role;
|
||||
}
|
||||
|
||||
get currentProjectMemberInfo() {
|
||||
@ -132,7 +132,7 @@ class UserStore implements IUserStore {
|
||||
|
||||
get currentProjectRole() {
|
||||
if (!this.rootStore.project.projectId) return;
|
||||
return this.projectMemberInfo[this.rootStore.project.projectId].role;
|
||||
return this.projectMemberInfo[this.rootStore.project.projectId]?.role;
|
||||
}
|
||||
|
||||
get hasPermissionToCurrentWorkspace() {
|
||||
|
Loading…
Reference in New Issue
Block a user