Skip to content

Commit 4c99a9a

Browse files
committed
Refactor replies
1 parent 9c8d8f3 commit 4c99a9a

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

loading_sdk/sync_api/client.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -491,11 +491,7 @@ def get_total_thread_pages(self, thread_id):
491491
return response
492492

493493
thread_start = response["data"]["posts"][-1]
494-
replies = thread_start["replies"]
495-
496-
if replies < 1:
497-
replies = 1
498-
494+
replies = max(thread_start["replies"], 1)
499495
pages = math.ceil(replies / POSTS_PER_PAGE)
500496

501497
return pages

0 commit comments

Comments
 (0)