Spaces:
Running
Running
ChenyuRabbitLove
commited on
Commit
•
8f7267a
1
Parent(s):
16d9871
bugfix: fix minor bugs
Browse files
app.py
CHANGED
@@ -314,44 +314,44 @@ with gr.Blocks(theme=seafoam, css=get_content("css/style.css")) as demo:
|
|
314 |
api_name="pull_newest_player_data",
|
315 |
)
|
316 |
|
317 |
-
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
-
|
329 |
-
|
330 |
-
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
|
335 |
-
|
336 |
-
|
337 |
-
|
338 |
-
|
339 |
-
|
340 |
-
|
341 |
|
342 |
-
|
343 |
-
|
344 |
-
|
345 |
-
|
346 |
-
|
347 |
-
|
348 |
-
|
349 |
-
|
350 |
-
|
351 |
-
|
352 |
-
|
353 |
-
|
354 |
-
|
355 |
|
356 |
# cancel_player_name.click(
|
357 |
# lambda: (gr.update(interactive=True), gr.update(visible=True)),
|
|
|
314 |
api_name="pull_newest_player_data",
|
315 |
)
|
316 |
|
317 |
+
def create_visibility_updates(visible, count):
|
318 |
+
return tuple(gr.update(visible=visible) for _ in range(count))
|
319 |
+
|
320 |
+
start_make_reward.click(
|
321 |
+
check_is_in_completion_reward,
|
322 |
+
player_backend_id,
|
323 |
+
[
|
324 |
+
start_make_reward,
|
325 |
+
player_name_title,
|
326 |
+
player_name,
|
327 |
+
confirm_player_name,
|
328 |
+
not_participate,
|
329 |
+
not_start,
|
330 |
+
already_issued,
|
331 |
+
],
|
332 |
+
queue=False,
|
333 |
+
)
|
334 |
|
335 |
+
set_player_name_args = dict(
|
336 |
+
fn=set_player_name,
|
337 |
+
inputs=[completion_reward, player_name, player_backend_id],
|
338 |
+
outputs=None,
|
339 |
+
queue=False,
|
340 |
+
)
|
341 |
|
342 |
+
confirm_player_name.click(
|
343 |
+
lambda: (gr.update(interactive=False), gr.update(visible=False)),
|
344 |
+
None,
|
345 |
+
[player_name, confirm_player_name],
|
346 |
+
queue=False,
|
347 |
+
).then(
|
348 |
+
lambda: create_visibility_updates(True, 2),
|
349 |
+
None,
|
350 |
+
[cancel_player_name, player_name_next_step],
|
351 |
+
queue=False,
|
352 |
+
).then(
|
353 |
+
**set_player_name_args
|
354 |
+
)
|
355 |
|
356 |
# cancel_player_name.click(
|
357 |
# lambda: (gr.update(interactive=True), gr.update(visible=True)),
|