fix: store level fixes (#2597)
This commit is contained in:
parent
d46eb9c59a
commit
8c620c4f96
25 changed files with 233 additions and 185 deletions
|
|
@ -41,6 +41,8 @@ export interface IProjectStore {
|
|||
joinedProjects: IProject[];
|
||||
favoriteProjects: IProject[];
|
||||
|
||||
currentProjectDetails: IProject | undefined;
|
||||
|
||||
// actions
|
||||
setProjectId: (projectId: string) => void;
|
||||
setSearchQuery: (query: string) => void;
|
||||
|
|
@ -137,6 +139,8 @@ export class ProjectStore implements IProjectStore {
|
|||
projectMembers: computed,
|
||||
projectEstimates: computed,
|
||||
|
||||
currentProjectDetails: computed,
|
||||
|
||||
joinedProjects: computed,
|
||||
favoriteProjects: computed,
|
||||
|
||||
|
|
@ -198,6 +202,11 @@ export class ProjectStore implements IProjectStore {
|
|||
return this.projects?.[this.rootStore.workspace.workspaceSlug];
|
||||
}
|
||||
|
||||
get currentProjectDetails() {
|
||||
if (!this.projectId) return;
|
||||
return this.project_details[this.projectId];
|
||||
}
|
||||
|
||||
get joinedProjects() {
|
||||
if (!this.rootStore.workspace.workspaceSlug) return [];
|
||||
return this.projects?.[this.rootStore.workspace.workspaceSlug]?.filter((p) => p.is_member);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue