From 2a32cc34efc07cc8378be9b28508c67ad3a4cafa Mon Sep 17 00:00:00 2001 From: Sebastian Date: Sat, 15 Nov 2025 15:02:21 +0100 Subject: [PATCH] Sync result can be seen multiple times --- sync_window.gd | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/sync_window.gd b/sync_window.gd index 0b08d0c..ae41ba1 100644 --- a/sync_window.gd +++ b/sync_window.gd @@ -59,6 +59,8 @@ var sync_timer: Timer = %SyncTimer var changes: bool = false +var has_synced: bool = false + signal sync_started signal sync_finished @@ -75,13 +77,14 @@ func _input(event: InputEvent) -> void: func start_sync() -> void: print("start_sync") self.visible = true - var sync_request_sent: Callable = func sync_request_sent() -> void: - sync_timer.start(0.75) - Settings.currently_syncing = true - sync_started.emit() - show_sync_progress() - if !Settings.currently_syncing: - Settings.make_request2("/sync", sync_request_sent, false) + if !has_synced: + var sync_request_sent: Callable = func sync_request_sent() -> void: + sync_timer.start(0.75) + Settings.currently_syncing = true + sync_started.emit() + show_sync_progress() + if !Settings.currently_syncing: + Settings.make_request2("/sync", sync_request_sent, false) func _on_sync_timeout() -> void: print("_on_sync_timeout!") @@ -97,6 +100,7 @@ func _on_sync_timeout() -> void: Settings.make_request2("/sync/progress", get_progress, true) func on_sync_finished(data_received: Dictionary) -> void: + has_synced = true reset_sync_result() if data_received.games_added != null: changes = true