Spaces:
Running
Running
Update dashboard.py
Browse files- 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,
|
177 |
-
gr.update(
|
|
|
|
|
178 |
)
|
179 |
else:
|
180 |
return (
|
181 |
gr.update(value="β Invalid email or password.", visible=True),
|
182 |
-
False,
|
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],
|