Skip to content

Commit 936cf2f

Browse files
Niloth-psumanthvrao
andcommitted
core: Track if the current narrow is empty.
Co-authored-by: Sumanth V Rao <[email protected]>
1 parent 4992dbe commit 936cf2f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

zulipterminal/core.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ def __init__(
9393

9494
self.active_conversation_info: Dict[str, Any] = {}
9595
self.is_typing_notification_in_progress = False
96+
self.is_in_empty_narrow = False
9697

9798
self.show_loading()
9899
client_identifier = f"ZulipTerminal/{ZT_VERSION} {platform()}"
@@ -598,6 +599,7 @@ def _narrow_to(self, anchor: Optional[int], **narrow: Any) -> None:
598599
if len(msg_id_list) == 0 or (anchor is not None and anchor not in msg_id_list):
599600
self.model.get_messages(num_before=30, num_after=10, anchor=anchor)
600601
msg_id_list = self.model.get_message_ids_in_current_narrow()
602+
self.is_in_empty_narrow = bool(len(msg_id_list) == 0)
601603

602604
w_list = create_msg_box_list(self.model, msg_id_list, focus_msg_id=anchor)
603605

0 commit comments

Comments
 (0)