@@ -51,7 +51,9 @@ def __init__(self, mainwindow: TuiApp, interface: Interface) -> None:
51
51
)
52
52
self .mainwindow = mainwindow
53
53
self .interface = interface
54
- self .searching_remote_popup : SearchingRemoteForNextSubSesPopup | None
54
+ self .searching_remote_popup : (
55
+ SearchingRemoteForNextSubSesPopup | None
56
+ ) = None
55
57
56
58
self .prev_click_time = 0.0
57
59
@@ -145,7 +147,7 @@ async def refresh_after_datatypes_changed(self, ignore):
145
147
self .on_mount ()
146
148
147
149
@require_double_click
148
- async def on_clickable_input_clicked (
150
+ def on_clickable_input_clicked (
149
151
self , event : ClickableInput .Clicked
150
152
) -> None :
151
153
"""
@@ -167,7 +169,7 @@ async def on_clickable_input_clicked(
167
169
"suggest_next_sub_ses_remote"
168
170
]
169
171
170
- await self .suggest_next_sub_ses_with_popup (
172
+ self .suggest_next_sub_ses_with_popup (
171
173
prefix , input_id , include_central
172
174
)
173
175
@@ -363,28 +365,30 @@ def fill_input_with_next_sub_or_ses_template(
363
365
input = self .query_one (f"#{ input_id } " )
364
366
input .value = fill_value
365
367
366
- async def suggest_next_sub_ses_with_popup (
368
+ async def fill_suggestion_and_dismiss_popup (
369
+ self , prefix , input_id , include_central
370
+ ):
371
+ worker = self .fill_input_with_next_sub_or_ses_template (
372
+ prefix , input_id , include_central
373
+ )
374
+ await worker .wait ()
375
+ if self .searching_remote_popup :
376
+ self .searching_remote_popup .dismiss ()
377
+ self .searching_remote_popup = None
378
+
379
+ def suggest_next_sub_ses_with_popup (
367
380
self , prefix : Prefix , input_id : str , include_central : bool
368
381
):
369
382
if include_central :
370
383
searching_remote_popup = SearchingRemoteForNextSubSesPopup (prefix )
371
384
self .searching_remote_popup = searching_remote_popup
372
385
self .mainwindow .push_screen (searching_remote_popup )
373
386
374
- async def _fill_suggestion_and_dismiss_popup ():
375
- worker = self .fill_input_with_next_sub_or_ses_template (
376
- prefix , input_id , include_central
377
- )
378
- await worker .wait ()
379
- if self .searching_remote_popup :
380
- searching_remote_popup .dismiss ()
381
-
382
- asyncio .create_task (_fill_suggestion_and_dismiss_popup ())
383
- else :
384
- worker = self .fill_input_with_next_sub_or_ses_template (
387
+ asyncio .create_task (
388
+ self .fill_suggestion_and_dismiss_popup (
385
389
prefix , input_id , include_central
386
390
)
387
- await worker . wait ( )
391
+ )
388
392
389
393
def run_local_validation (self , prefix : Prefix ):
390
394
"""
0 commit comments