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 changes: bool = false
|
||||||
|
|
||||||
|
var has_synced: bool = false
|
||||||
|
|
||||||
signal sync_started
|
signal sync_started
|
||||||
signal sync_finished
|
signal sync_finished
|
||||||
|
|
||||||
@@ -75,13 +77,14 @@ func _input(event: InputEvent) -> void:
|
|||||||
func start_sync() -> void:
|
func start_sync() -> void:
|
||||||
print("start_sync")
|
print("start_sync")
|
||||||
self.visible = true
|
self.visible = true
|
||||||
var sync_request_sent: Callable = func sync_request_sent() -> void:
|
if !has_synced:
|
||||||
sync_timer.start(0.75)
|
var sync_request_sent: Callable = func sync_request_sent() -> void:
|
||||||
Settings.currently_syncing = true
|
sync_timer.start(0.75)
|
||||||
sync_started.emit()
|
Settings.currently_syncing = true
|
||||||
show_sync_progress()
|
sync_started.emit()
|
||||||
if !Settings.currently_syncing:
|
show_sync_progress()
|
||||||
Settings.make_request2("/sync", sync_request_sent, false)
|
if !Settings.currently_syncing:
|
||||||
|
Settings.make_request2("/sync", sync_request_sent, false)
|
||||||
|
|
||||||
func _on_sync_timeout() -> void:
|
func _on_sync_timeout() -> void:
|
||||||
print("_on_sync_timeout!")
|
print("_on_sync_timeout!")
|
||||||
@@ -97,6 +100,7 @@ func _on_sync_timeout() -> void:
|
|||||||
Settings.make_request2("/sync/progress", get_progress, true)
|
Settings.make_request2("/sync/progress", get_progress, true)
|
||||||
|
|
||||||
func on_sync_finished(data_received: Dictionary) -> void:
|
func on_sync_finished(data_received: Dictionary) -> void:
|
||||||
|
has_synced = true
|
||||||
reset_sync_result()
|
reset_sync_result()
|
||||||
if data_received.games_added != null:
|
if data_received.games_added != null:
|
||||||
changes = true
|
changes = true
|
||||||
|
|||||||
Reference in New Issue
Block a user