Skip to content

Commit

Permalink
check on session rather than emitter (Chainlit#448)
Browse files Browse the repository at this point in the history
  • Loading branch information
willydouhard authored Oct 3, 2023
1 parent fb936c9 commit c917e5c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/chainlit/user_session.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class UserSession:
"""

def get(self, key, default=None):
if not context.emitter:
if not context.session:
return default

if context.session.id not in user_sessions:
Expand All @@ -46,7 +46,7 @@ def get(self, key, default=None):
return user_session.get(key, default)

def set(self, key, value):
if not context.emitter:
if not context.session:
return None

if context.session.id not in user_sessions:
Expand Down

0 comments on commit c917e5c

Please sign in to comment.