parass13 commited on
Commit
0432585
Β·
verified Β·
1 Parent(s): 52452fe

Update dashboard.py

Browse files
Files changed (1) hide show
  1. dashboard.py +9 -4
dashboard.py CHANGED
@@ -173,14 +173,18 @@ with gr.Blocks(theme=gr.themes.Soft(), title="Deepfake Detector") as demo:
173
  if login_user(email, password):
174
  return (
175
  gr.update(value="βœ… Login successful!", visible=True),
176
- True, gr.update(visible=False), gr.update(visible=True),
177
- gr.update(selected=DETECT_TAB_NAME)
 
 
178
  )
179
  else:
180
  return (
181
  gr.update(value="❌ Invalid email or password.", visible=True),
182
- False, gr.update(), gr.update(), gr.update()
183
- )
 
 
184
 
185
  def handle_signup(name, phone, email, password):
186
  msg = register_user(name, phone, email, password)
@@ -211,6 +215,7 @@ with gr.Blocks(theme=gr.themes.Soft(), title="Deepfake Detector") as demo:
211
  outputs=[message_output, is_logged_in, login_tab, detect_tab, tabs]
212
  )
213
 
 
214
  signup_btn.click(
215
  fn=handle_signup,
216
  inputs=[name_signup, phone_signup, email_signup, password_signup],
 
173
  if login_user(email, password):
174
  return (
175
  gr.update(value="βœ… Login successful!", visible=True),
176
+ True, # is_logged_in
177
+ gr.update(visible=False), # hide login tab
178
+ gr.update(visible=True), # show detect tab
179
+ gr.update(selected=DETECT_TAB_NAME) # switch to detect tab
180
  )
181
  else:
182
  return (
183
  gr.update(value="❌ Invalid email or password.", visible=True),
184
+ False,
185
+ gr.update(), gr.update(), gr.update()
186
+ )
187
+
188
 
189
  def handle_signup(name, phone, email, password):
190
  msg = register_user(name, phone, email, password)
 
215
  outputs=[message_output, is_logged_in, login_tab, detect_tab, tabs]
216
  )
217
 
218
+
219
  signup_btn.click(
220
  fn=handle_signup,
221
  inputs=[name_signup, phone_signup, email_signup, password_signup],