Skip to content

Commit dfb45f8

Browse files
sync board state better
Signed-off-by: Jonathan Irvin <djfoxyslpr@gmail.com>
1 parent b491e78 commit dfb45f8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,6 @@ def create_board_view(background_color: str, is_global: bool):
344344
build_board(container, tile_buttons, toggle_tile)
345345
board_views["home"] = (container, tile_buttons)
346346
# Add timers for synchronizing the global board.
347-
ui.timer(0.1, sync_board_state)
348347
ui.timer(1, check_phrases_file_change)
349348
global seed_label
350349
with ui.row().classes("w-full mt-4 items-center justify-center gap-4"):
@@ -359,15 +358,16 @@ def create_board_view(background_color: str, is_global: bool):
359358
local_tile_buttons = {}
360359
build_board(container, local_tile_buttons, toggle_tile)
361360
board_views["stream"] = (container, local_tile_buttons)
362-
ui.timer(0.1, sync_board_state)
363361

364362
@ui.page("/")
365363
def home_page():
366364
create_board_view(HOME_BG_COLOR, True)
365+
ui.timer(0.1, sync_board_state)
367366

368367
@ui.page("/stream")
369368
def stream_page():
370369
create_board_view(STREAM_BG_COLOR, False)
370+
ui.timer(0.1, sync_board_state)
371371

372372
def setup_head(background_color: str):
373373
"""
@@ -479,7 +479,7 @@ def build_board(parent, tile_buttons_dict: dict, on_tile_click):
479479
lines = split_phrase_into_lines(phrase)
480480
line_count = len(lines)
481481
for line in lines:
482-
with ui.row().classes("w-full"):
482+
with ui.row().classes("w-full items-center justify-center"):
483483
base_class = LABEL_SMALL_CLASSES if len(line) <= 3 else LABEL_CLASSES
484484
lbl = ui.label(line).classes(base_class).style(get_line_style_for_lines(line_count, default_text_color))
485485
labels_list.append({

0 commit comments

Comments
 (0)