vibhorag101 commited on
Commit
c5048d8
1 Parent(s): 5ae8430

Force Dark Mode

Browse files
Files changed (1) hide show
  1. app.py +13 -1
app.py CHANGED
@@ -4,6 +4,18 @@ import plotly.graph_objects as go
4
  from datetime import datetime, timedelta
5
  import requests
6
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  def get_nav_data(scheme_code):
8
  url = f"https://api.mfapi.in/mf/{scheme_code}"
9
  response = requests.get(url)
@@ -190,7 +202,7 @@ def update_schemes_table(schemes_list):
190
  def create_ui():
191
  schemes_df = fetch_scheme_data()
192
 
193
- with gr.Blocks(theme="dark") as app:
194
  gr.Markdown("# Mutual Fund SIP Returns Calculator")
195
 
196
  with gr.Row():
 
4
  from datetime import datetime, timedelta
5
  import requests
6
 
7
+
8
+ js_func = """
9
+ function refresh() {
10
+ const url = new URL(window.location);
11
+
12
+ if (url.searchParams.get('__theme') !== 'dark') {
13
+ url.searchParams.set('__theme', 'dark');
14
+ window.location.href = url.href;
15
+ }
16
+ }
17
+ """
18
+
19
  def get_nav_data(scheme_code):
20
  url = f"https://api.mfapi.in/mf/{scheme_code}"
21
  response = requests.get(url)
 
202
  def create_ui():
203
  schemes_df = fetch_scheme_data()
204
 
205
+ with gr.Blocks(js=js_func) as app:
206
  gr.Markdown("# Mutual Fund SIP Returns Calculator")
207
 
208
  with gr.Row():