Parishri07 commited on
Commit
da8be8f
Β·
verified Β·
1 Parent(s): 9bdbf71

Update ui/navigator_tab.py

Browse files
Files changed (1) hide show
  1. ui/navigator_tab.py +7 -1
ui/navigator_tab.py CHANGED
@@ -18,11 +18,15 @@ def reset_all():
18
  {} # state
19
  )
20
 
 
 
 
 
21
  # Main UI builder
22
  def create_navigator_tab():
23
  with gr.TabItem("🧭 Navigator"):
24
  with gr.Row():
25
- country = gr.Dropdown(label="🌍 Country", choices=get_subfolders(BASE_DIR), value=None, interactive=True)
26
  state = gr.Dropdown(label="πŸ™ State", choices=[], interactive=True)
27
  city = gr.Dropdown(label="🏘 City", choices=[], interactive=True)
28
  store = gr.Dropdown(label="πŸͺ Store", choices=[], interactive=True)
@@ -80,3 +84,5 @@ def create_navigator_tab():
80
  result, data_state
81
  ]
82
  )
 
 
 
18
  {} # state
19
  )
20
 
21
+ # Load choices on app load
22
+ def load_initial_country_choices():
23
+ return gr.update(choices=get_subfolders(BASE_DIR), value=None)
24
+
25
  # Main UI builder
26
  def create_navigator_tab():
27
  with gr.TabItem("🧭 Navigator"):
28
  with gr.Row():
29
+ country = gr.Dropdown(label="🌍 Country", choices=[], interactive=True)
30
  state = gr.Dropdown(label="πŸ™ State", choices=[], interactive=True)
31
  city = gr.Dropdown(label="🏘 City", choices=[], interactive=True)
32
  store = gr.Dropdown(label="πŸͺ Store", choices=[], interactive=True)
 
84
  result, data_state
85
  ]
86
  )
87
+
88
+ return country, # so we can use it in demo.load() from layout.py