Workpam commited on
Commit
fa54e2c
·
verified ·
1 Parent(s): a08ec1c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -722,7 +722,7 @@ with gr.Blocks(css=css) as demo:
722
  )
723
 
724
  clear_btn.click(
725
- fn=clear_all, # Python: deletes temp folder & resets all Gradio components
726
  inputs=[temp_dir_state],
727
  outputs=[
728
  workbook_upload,
@@ -734,7 +734,7 @@ with gr.Blocks(css=css) as demo:
734
  temp_dir_state,
735
  image_url_input
736
  ],
737
- js="""
738
  // 1) Clear all browser storage
739
  localStorage.clear();
740
  sessionStorage.clear();
@@ -748,13 +748,15 @@ with gr.Blocks(css=css) as demo:
748
 
749
  // 3) Scroll the status box back to the top
750
  const el = document.getElementById('status-box');
751
- if (el) { el.scrollTop = 0; }
752
 
753
- return [];
754
- """
 
755
  )
756
 
757
 
 
758
  stop_btn.click(
759
  fn=lambda: "🛑 Stop signal sent",
760
  outputs=[status]
 
722
  )
723
 
724
  clear_btn.click(
725
+ fn=clear_all,
726
  inputs=[temp_dir_state],
727
  outputs=[
728
  workbook_upload,
 
734
  temp_dir_state,
735
  image_url_input
736
  ],
737
+ js="""() => {
738
  // 1) Clear all browser storage
739
  localStorage.clear();
740
  sessionStorage.clear();
 
748
 
749
  // 3) Scroll the status box back to the top
750
  const el = document.getElementById('status-box');
751
+ if (el) el.scrollTop = 0;
752
 
753
+ // 4) Return placeholders for each Python output
754
+ return [null, [], [], {visible: false, value: null}, [], "Cleared.", null, ""];
755
+ }"""
756
  )
757
 
758
 
759
+
760
  stop_btn.click(
761
  fn=lambda: "🛑 Stop signal sent",
762
  outputs=[status]