Skip to content

Commit

Permalink
redirect to "/saved/" when opening a workspace from global selector
Browse files Browse the repository at this point in the history
  • Loading branch information
nikochiko committed Feb 20, 2025
1 parent 1f13996 commit ee7fb8b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions workspaces/widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

def global_workspace_selector(user: AppUser, session: dict):
from daras_ai_v2.base import BasePage
from routers.account import members_route, profile_route
from routers.account import members_route, profile_route, saved_route

try:
del user.cached_workspaces # invalidate cache on every re-render
Expand All @@ -24,7 +24,7 @@ def global_workspace_selector(user: AppUser, session: dict):
if switch_workspace_id := gui.session_state.pop(SWITCH_WORKSPACE_KEY, None):
try:
if str(session[SESSION_SELECTED_WORKSPACE]) == switch_workspace_id:
raise gui.RedirectException(get_route_path(members_route))
raise gui.RedirectException(get_route_path(saved_route))
except KeyError:
pass
set_current_workspace(session, int(switch_workspace_id))
Expand Down Expand Up @@ -102,7 +102,7 @@ def global_workspace_selector(user: AppUser, session: dict):
else:
gui.html('<hr class="my-1"/>')
with gui.link(
to=get_route_path(members_route),
to=get_route_path(saved_route),
className="text-decoration-none d-block bg-hover-light px-3 my-1 py-1",
style=dict(height=row_height),
):
Expand Down

0 comments on commit ee7fb8b

Please sign in to comment.