None-fix2

This commit is contained in:
Untone 2023-10-13 02:24:26 +03:00
parent 89736e4f45
commit e9b2e55502

View File

@ -45,7 +45,8 @@ async def load_messages(chat_id: str, limit: int = 5, offset: int = 0, ids=None)
async def load_chats(_, info, limit: int = 50, offset: int = 0): async def load_chats(_, info, limit: int = 50, offset: int = 0):
"""load :limit chats of current user with :offset""" """load :limit chats of current user with :offset"""
author_id = info.context["author_id"] author_id = info.context["author_id"]
cids = (list(await redis.execute("SMEMBERS", f"chats_by_author/{author_id}") or []) cids = list(
(await redis.execute("SMEMBERS", f"chats_by_author/{author_id}")) or []
)[offset:(offset + limit)] )[offset:(offset + limit)]
members_online = (await redis.execute("SMEMBERS", "authors-online")) or [] members_online = (await redis.execute("SMEMBERS", "authors-online")) or []
chats = [] chats = []