Skip to content
Merged
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
6 changes: 2 additions & 4 deletions web/core/store/project/project.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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");
Expand Down