Skip to content

Commit

Permalink
Remove duplicated bookmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
oeway committed Sep 4, 2024
1 parent ef6b96f commit aca5a8f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion hypha/VERSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "0.20.33.post1"
"version": "0.20.33.post2"
}
5 changes: 5 additions & 0 deletions hypha/core/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,9 @@ async def _bookmark_workspace(
user_workspace.config = user_workspace.config or {}
if "bookmarks" not in user_workspace.config:
user_workspace.config["bookmarks"] = []
for bookmark in user_workspace.config["bookmarks"]:
if bookmark["name"] == workspace.name:
return
user_workspace.config["bookmarks"].append(
{
"type": "workspace",
Expand Down Expand Up @@ -1155,6 +1158,8 @@ async def list_workspaces(
"description": workspace.description,
}
]
# remove duplicates
workspaces = [dict(t) for t in {tuple(d.items()) for d in workspaces}]
return workspaces

async def _update_workspace(
Expand Down

0 comments on commit aca5a8f

Please sign in to comment.