mirror of
https://github.com/makeplane/plane.git
synced 2026-07-13 14:01:45 +02:00
fix: build and types (#3270)
* fix: build and types * fix: teamspace page store
This commit is contained in:
@@ -228,20 +228,4 @@ export class ProjectPage extends BasePage implements TProjectPage {
|
||||
throw error;
|
||||
}
|
||||
};
|
||||
|
||||
getOrFetchPageInstance = async (pageId: string) => {
|
||||
const pageInstance = this.rootStore.projectPages.getPageById(pageId);
|
||||
if (pageInstance) {
|
||||
return pageInstance;
|
||||
} else {
|
||||
if (!this.workspace) return;
|
||||
const workspaceSlug = this.rootStore.workspaceRoot.getWorkspaceById(this.workspace)?.slug;
|
||||
const projectId = this.project_ids?.[0];
|
||||
if (!workspaceSlug || !projectId) return;
|
||||
const page = await this.rootStore.projectPages.fetchPageDetails(projectId, pageId);
|
||||
if (page) {
|
||||
return new ProjectPage(this.rootStore, page);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ export const usePageActionsMenu = (props: {
|
||||
// Traverse up the parent chain until we reach the root
|
||||
while (currentPage?.parent_id) {
|
||||
// Get the parent page
|
||||
currentPage = (await getOrFetchPageInstance(currentPage.parent_id)) as TPageInstance;
|
||||
currentPage = (await getOrFetchPageInstance({ pageId: currentPage.parent_id })) as TPageInstance;
|
||||
// If we found an archived parent, remember it
|
||||
if (currentPage?.archived_at) {
|
||||
lastArchivedParent = currentPage;
|
||||
|
||||
@@ -402,7 +402,11 @@ export class TeamspacePageStore implements ITeamspacePageStore {
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
removePageInstance = (pageId: string) => {
|
||||
delete this.data[pageId];
|
||||
const page = this.getPageById(pageId);
|
||||
if (page && page.team) {
|
||||
delete this.pageMap[page.team][pageId];
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user