diff --git a/resolvers/load.py b/resolvers/load.py index d30db16..5350560 100644 --- a/resolvers/load.py +++ b/resolvers/load.py @@ -53,9 +53,9 @@ async def load_messages( async def load_chats(_, info, limit: int = 50, offset: int = 0) -> Dict[str, Union[List[Dict[str, Any]], None]]: """load :limit chats of current user with :offset""" author_id = info.context.get("author_id") + chats = [] if author_id: cids = await redis.execute("SMEMBERS", f"chats_by_author/{author_id}") - chats = [] if cids: members_online = (await redis.execute("SMEMBERS", "authors-online")) or [] cids = list(cids)[offset : (offset + limit)]