idolezal commited on
Commit
291b241
1 Parent(s): 36141d4

Disable Yes/No buttons until files uploaded

Browse files
Files changed (1) hide show
  1. app.py +23 -0
app.py CHANGED
@@ -275,6 +275,17 @@ def show_modal():
275
  def hide_modal():
276
  return gr.update(visible=False)
277
 
 
 
 
 
 
 
 
 
 
 
 
278
 
279
  def on_application_load():
280
  with leaderboard_server.var_lock.ro:
@@ -538,6 +549,12 @@ def gradio_app():
538
  )
539
 
540
  modal_submit_yes.click(
 
 
 
 
 
 
541
  fn=submit_results,
542
  outputs=[
543
  pre_submission_btn,
@@ -553,6 +570,12 @@ def gradio_app():
553
  category_of_tasks,
554
  tournament_results_dropdown,
555
  ],
 
 
 
 
 
 
556
  )
557
 
558
  modal_submit_no.click(
 
275
  def hide_modal():
276
  return gr.update(visible=False)
277
 
278
+ def disable_submission_buttons():
279
+ return (
280
+ gr.update(interactive=False),
281
+ gr.update(interactive=False),
282
+ )
283
+
284
+ def enable_submission_buttons():
285
+ return (
286
+ gr.update(interactive=True),
287
+ gr.update(interactive=True),
288
+ )
289
 
290
  def on_application_load():
291
  with leaderboard_server.var_lock.ro:
 
549
  )
550
 
551
  modal_submit_yes.click(
552
+ fn=disable_submission_buttons,
553
+ outputs=[
554
+ submission_btn_yes,
555
+ submission_btn_no,
556
+ ]
557
+ ).then(
558
  fn=submit_results,
559
  outputs=[
560
  pre_submission_btn,
 
570
  category_of_tasks,
571
  tournament_results_dropdown,
572
  ],
573
+ ).then(
574
+ fn=enable_submission_buttons,
575
+ outputs=[
576
+ submission_btn_yes,
577
+ submission_btn_no,
578
+ ]
579
  )
580
 
581
  modal_submit_no.click(