File tree Expand file tree Collapse file tree
examples/chem-sync-local-flask/local_app/benchling_app/views Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1515 SectionUiBlockType ,
1616)
1717
18+ from local_app .benchling_app .views .canvas_initialize import input_blocks
1819from local_app .benchling_app .views .constants import (
1920 CANCEL_BUTTON_ID ,
2021 CID_KEY ,
@@ -43,11 +44,18 @@ def render_preview_canvas(
4344 canvas_builder .to_update (),
4445 )
4546 else :
47+ user_input = canvas_builder .inputs_to_dict ()[SEARCH_TEXT_ID ]
48+ # Clear the search input and re-enable canvas so user can input a new search
49+ canvas_builder = canvas_builder .with_blocks (input_blocks ()).with_enabled ()
50+ session .app .benchling .apps .update_canvas (
51+ canvas_id ,
52+ canvas_builder .to_update (),
53+ )
4654 session .close_session (
4755 AppSessionUpdateStatus .SUCCEEDED ,
4856 messages = [
4957 AppSessionMessageCreate (
50- f"Couldn't find any chemicals for '{ canvas_builder . inputs_to_dict ()[ SEARCH_TEXT_ID ] } '" ,
58+ f"Couldn't find any chemicals for '{ user_input } '" ,
5159 style = AppSessionMessageStyle .INFO ,
5260 ),
5361 ],
You can’t perform that action at this time.
0 commit comments