fix: reloading on favorite action (#5313)
This commit is contained in:
parent
3279bb6ac9
commit
806eae0139
1 changed files with 2 additions and 4 deletions
|
|
@ -285,7 +285,6 @@ export class ProjectStore implements IProjectStore {
|
|||
project_id: projectId,
|
||||
entity_data: { name: this.projectMap[projectId].name || "" },
|
||||
});
|
||||
await this.fetchProjects(workspaceSlug);
|
||||
return response;
|
||||
} catch (error) {
|
||||
console.log("Failed to add project to favorite");
|
||||
|
|
@ -306,12 +305,11 @@ export class ProjectStore implements IProjectStore {
|
|||
try {
|
||||
const currentProject = this.getProjectById(projectId);
|
||||
if (!currentProject.is_favorite) return;
|
||||
const response = await this.rootStore.favorite.removeFavoriteEntity(workspaceSlug.toString(), projectId);
|
||||
|
||||
runInAction(() => {
|
||||
set(this.projectMap, [projectId, "is_favorite"], false);
|
||||
});
|
||||
await this.fetchProjects(workspaceSlug);
|
||||
const response = await this.rootStore.favorite.removeFavoriteEntity(workspaceSlug.toString(), projectId);
|
||||
|
||||
return response;
|
||||
} catch (error) {
|
||||
console.log("Failed to add project to favorite");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue