Sync result can be seen multiple times
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user