Spaces:
Running
Running
ChenyuRabbitLove
commited on
Commit
•
2429967
1
Parent(s):
f73342b
bugfix: fix minor bugs
Browse files
app.py
CHANGED
@@ -206,6 +206,11 @@ with gr.Blocks(theme=seafoam, css=get_content("css/style.css")) as demo:
|
|
206 |
visible=False,
|
207 |
)
|
208 |
|
|
|
|
|
|
|
|
|
|
|
209 |
with gr.Row():
|
210 |
confirm_player_name = gr.Button(
|
211 |
"確認暱稱", elem_id="confirm_player_name", visible=False
|
@@ -213,9 +218,6 @@ with gr.Blocks(theme=seafoam, css=get_content("css/style.css")) as demo:
|
|
213 |
cancel_player_name = gr.Button(
|
214 |
"取消", elem_id="cancel_player_name", visible=False
|
215 |
)
|
216 |
-
player_name_too_long = gr.Markdown(
|
217 |
-
"# 暱稱過長,請重新輸入", visible=False, elem_id="player_name_too_long"
|
218 |
-
)
|
219 |
|
220 |
with gr.Row():
|
221 |
player_name_next_step = gr.Button(
|
@@ -381,7 +383,7 @@ with gr.Blocks(theme=seafoam, css=get_content("css/style.css")) as demo:
|
|
381 |
gr.update(visible=True),
|
382 |
)
|
383 |
else:
|
384 |
-
return gr.update(visible=True), gr.update(visible=True), gr.update(False)
|
385 |
|
386 |
confirm_player_name.click(
|
387 |
lambda: (gr.update(interactive=False), gr.update(visible=False)),
|
@@ -398,9 +400,9 @@ with gr.Blocks(theme=seafoam, css=get_content("css/style.css")) as demo:
|
|
398 |
)
|
399 |
|
400 |
cancel_player_name.click(
|
401 |
-
lambda: (gr.update(interactive=True), gr.update(visible=True)),
|
402 |
None,
|
403 |
-
[player_name, confirm_player_name],
|
404 |
queue=False,
|
405 |
).then(
|
406 |
lambda: create_visibility_updates(False, 2),
|
|
|
206 |
visible=False,
|
207 |
)
|
208 |
|
209 |
+
with gr.Row():
|
210 |
+
player_name_too_long = gr.Markdown(
|
211 |
+
"# 暱稱過長,請重新輸入", visible=False, elem_id="player_name_too_long"
|
212 |
+
)
|
213 |
+
|
214 |
with gr.Row():
|
215 |
confirm_player_name = gr.Button(
|
216 |
"確認暱稱", elem_id="confirm_player_name", visible=False
|
|
|
218 |
cancel_player_name = gr.Button(
|
219 |
"取消", elem_id="cancel_player_name", visible=False
|
220 |
)
|
|
|
|
|
|
|
221 |
|
222 |
with gr.Row():
|
223 |
player_name_next_step = gr.Button(
|
|
|
383 |
gr.update(visible=True),
|
384 |
)
|
385 |
else:
|
386 |
+
return gr.update(visible=True), gr.update(visible=True), gr.update(visible=False)
|
387 |
|
388 |
confirm_player_name.click(
|
389 |
lambda: (gr.update(interactive=False), gr.update(visible=False)),
|
|
|
400 |
)
|
401 |
|
402 |
cancel_player_name.click(
|
403 |
+
lambda: (gr.update(interactive=True), gr.update(visible=True), gr.update(visible=False)),
|
404 |
None,
|
405 |
+
[player_name, confirm_player_name, player_name_too_long],
|
406 |
queue=False,
|
407 |
).then(
|
408 |
lambda: create_visibility_updates(False, 2),
|