Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions web/lib/mobx/store-init.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,13 @@ const MobxStoreInit = observer(() => {
*/
useEffect(() => {
if (workspaceSlug) setWorkspaceSlug(workspaceSlug.toString());
if (projectId) setProjectId(projectId.toString());
if (cycleId) setCycleId(cycleId.toString());
if (moduleId) setModuleId(moduleId.toString());
if (globalViewId) setGlobalViewId(globalViewId.toString());
if (viewId) setViewId(viewId.toString());
if (inboxId) setInboxId(inboxId.toString());

setProjectId(projectId?.toString() ?? null);
setCycleId(cycleId?.toString() ?? null);
setModuleId(moduleId?.toString() ?? null);
setGlobalViewId(globalViewId?.toString() ?? null);
setViewId(viewId?.toString() ?? null);
setInboxId(inboxId?.toString() ?? null);
}, [
workspaceSlug,
projectId,
Expand Down
4 changes: 2 additions & 2 deletions web/store/cycle/cycles.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export interface ICycleStore {
// actions
setCycleView: (_cycleView: TCycleView) => void;
setCycleLayout: (_cycleLayout: TCycleLayout) => void;
setCycleId: (cycleId: string) => void;
setCycleId: (cycleId: string | null) => void;

validateDate: (workspaceSlug: string, projectId: string, payload: CycleDateCheckData) => Promise<any>;

Expand Down Expand Up @@ -131,7 +131,7 @@ export class CycleStore implements ICycleStore {
// actions
setCycleView = (_cycleView: TCycleView) => (this.cycleView = _cycleView);
setCycleLayout = (_cycleLayout: TCycleLayout) => (this.cycleLayout = _cycleLayout);
setCycleId = (cycleId: string) => (this.cycleId = cycleId);
setCycleId = (cycleId: string | null) => (this.cycleId = cycleId);

validateDate = async (workspaceSlug: string, projectId: string, payload: CycleDateCheckData) => {
try {
Expand Down
4 changes: 2 additions & 2 deletions web/store/global-view/global_views.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface IGlobalViewsStore {
};

// actions
setGlobalViewId: (viewId: string) => void;
setGlobalViewId: (viewId: string | null) => void;

fetchAllGlobalViews: (workspaceSlug: string) => Promise<IWorkspaceView[]>;
fetchGlobalViewDetails: (workspaceSlug: string, viewId: string) => Promise<IWorkspaceView>;
Expand Down Expand Up @@ -72,7 +72,7 @@ export class GlobalViewsStore implements IGlobalViewsStore {
this.workspaceService = new WorkspaceService();
}

setGlobalViewId = (viewId: string) => {
setGlobalViewId = (viewId: string | null) => {
this.globalViewId = viewId;
};

Expand Down
4 changes: 2 additions & 2 deletions web/store/inbox/inbox.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export interface IInboxStore {
};

// actions
setInboxId: (inboxId: string) => void;
setInboxId: (inboxId: string | null) => void;

getInboxId: (projectId: string) => string | null;

Expand Down Expand Up @@ -100,7 +100,7 @@ export class InboxStore implements IInboxStore {
return this.inboxesList[projectId]?.[0]?.id ?? null;
};

setInboxId = (inboxId: string) => {
setInboxId = (inboxId: string | null) => {
runInAction(() => {
this.inboxId = inboxId;
});
Expand Down
6 changes: 3 additions & 3 deletions web/store/module/modules.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export interface IModuleStore {
};

// actions
setModuleId: (moduleSlug: string) => void;
setModuleId: (moduleId: string | null) => void;

getModuleById: (moduleId: string) => IModule | null;

Expand Down Expand Up @@ -144,8 +144,8 @@ export class ModuleStore implements IModuleStore {
getModuleById = (moduleId: string) => this.moduleDetails[moduleId] || null;

// actions
setModuleId = (moduleSlug: string) => {
this.moduleId = moduleSlug ?? null;
setModuleId = (moduleId: string | null) => {
this.moduleId = moduleId;
};

fetchModules = async (workspaceSlug: string, projectId: string) => {
Expand Down
4 changes: 2 additions & 2 deletions web/store/project-view/project_views.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface IProjectViewsStore {
};

// actions
setViewId: (viewId: string) => void;
setViewId: (viewId: string | null) => void;

fetchAllViews: (workspaceSlug: string, projectId: string) => Promise<IProjectView[]>;
fetchViewDetails: (workspaceSlug: string, projectId: string, viewId: string) => Promise<IProjectView>;
Expand Down Expand Up @@ -82,7 +82,7 @@ export class ProjectViewsStore implements IProjectViewsStore {
this.viewService = new ViewService();
}

setViewId = (viewId: string) => {
setViewId = (viewId: string | null) => {
this.viewId = viewId;
};

Expand Down
6 changes: 3 additions & 3 deletions web/store/project/project.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export interface IProjectStore {
currentProjectDetails: IProject | undefined;

// actions
setProjectId: (projectId: string) => void;
setProjectId: (projectId: string | null) => void;
setSearchQuery: (query: string) => void;

getProjectById: (workspaceSlug: string, projectId: string) => IProject | null;
Expand Down Expand Up @@ -251,8 +251,8 @@ export class ProjectStore implements IProjectStore {
}

// actions
setProjectId = (projectId: string) => {
this.projectId = projectId ?? null;
setProjectId = (projectId: string | null) => {
this.projectId = projectId;
};

setSearchQuery = (query: string) => {
Expand Down