5
5
from collections import OrderedDict
6
6
from functools import partial
7
7
from platform import platform
8
- from typing import Any , Optional , Tuple
8
+ from typing import Any , Callable , Optional , Tuple
9
9
10
10
import urwid
11
11
import zulip
@@ -158,6 +158,12 @@ def show_about(self) -> None:
158
158
server_feature_level = self .model .server_feature_level )
159
159
)
160
160
161
+ def show_confirmation_overlay (self , question : Any ,
162
+ success_callback : Callable [[], bool ],
163
+ ) -> None :
164
+ self .loop .widget = PopUpConfirmationView (self , question ,
165
+ success_callback )
166
+
161
167
def search_messages (self , text : str ) -> None :
162
168
# Search for a text in messages
163
169
self .model .index ['search' ].clear ()
@@ -181,8 +187,7 @@ def stream_muting_confirmation_popup(self, button: Any) -> None:
181
187
"center" )
182
188
mute_this_stream = partial (self .model .toggle_stream_muted_status ,
183
189
button .stream_id )
184
- self .loop .widget = PopUpConfirmationView (self , question ,
185
- mute_this_stream )
190
+ self .show_confirmation_overlay (question , mute_this_stream )
186
191
187
192
def _narrow_to (self , button : Any , anchor : Optional [int ],
188
193
** narrow : Any ) -> None :
0 commit comments