idolezal commited on
Commit
f0843f2
β€’
1 Parent(s): a1840bf

Disable Yes/No buttons until files uploaded

Browse files
Files changed (1) hide show
  1. app.py +8 -8
app.py CHANGED
@@ -276,13 +276,13 @@ def show_modal():
276
  def hide_modal():
277
  return gr.update(visible=False)
278
 
279
- def disable_submission_buttons():
280
  return (
281
  gr.update(interactive=False),
282
  gr.update(interactive=False),
283
  )
284
 
285
- def enable_submission_buttons():
286
  return (
287
  gr.update(interactive=True),
288
  gr.update(interactive=True),
@@ -551,10 +551,10 @@ def gradio_app():
551
  )
552
 
553
  modal_submit_yes.click(
554
- fn=disable_submission_buttons,
555
  outputs=[
556
- submission_btn_yes,
557
- submission_btn_no,
558
  ]
559
  ).then(
560
  fn=submit_results,
@@ -573,10 +573,10 @@ def gradio_app():
573
  tournament_results_dropdown,
574
  ],
575
  ).then(
576
- fn=enable_submission_buttons,
577
  outputs=[
578
- submission_btn_yes,
579
- submission_btn_no,
580
  ]
581
  )
582
 
 
276
  def hide_modal():
277
  return gr.update(visible=False)
278
 
279
+ def disable_submit_buttons():
280
  return (
281
  gr.update(interactive=False),
282
  gr.update(interactive=False),
283
  )
284
 
285
+ def enable_submit_buttons():
286
  return (
287
  gr.update(interactive=True),
288
  gr.update(interactive=True),
 
551
  )
552
 
553
  modal_submit_yes.click(
554
+ fn=disable_submit_buttons,
555
  outputs=[
556
+ modal_submit_yes,
557
+ modal_submit_no,
558
  ]
559
  ).then(
560
  fn=submit_results,
 
573
  tournament_results_dropdown,
574
  ],
575
  ).then(
576
+ fn=enable_submit_buttons,
577
  outputs=[
578
+ modal_submit_yes,
579
+ modal_submit_no,
580
  ]
581
  )
582