From f26eabf69b27ee87280332ba97f6db0e4908455c Mon Sep 17 00:00:00 2001 From: don-tnowe <67479453+don-tnowe@users.noreply.github.com> Date: Sun, 23 Oct 2022 16:31:07 +0300 Subject: [PATCH] Fix infinite realoading if table is empty --- addons/resources_speadsheet_view/editor_view.gd | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/addons/resources_speadsheet_view/editor_view.gd b/addons/resources_speadsheet_view/editor_view.gd index 1fe9c91..0a34122 100644 --- a/addons/resources_speadsheet_view/editor_view.gd +++ b/addons/resources_speadsheet_view/editor_view.gd @@ -92,7 +92,7 @@ func _on_filesystem_changed(): break -func display_folder(folderpath : String, sort_by : String = "", sort_reverse : bool = false, force_rebuild : bool = false): +func display_folder(folderpath : String, sort_by : String = "", sort_reverse : bool = false, force_rebuild : bool = false, is_echo : bool = false): if folderpath == "": return # Root folder resources tend to have MANY properties.W $"HeaderContentSplit/MarginContainer/FooterContentSplit/Panel/Label".visible = false if folderpath.ends_with(".tres") && !folderpath.ends_with(SpreadsheetImport.SUFFIX): @@ -115,10 +115,11 @@ func display_folder(folderpath : String, sort_by : String = "", sort_reverse : b current_path = folderpath _update_hidden_columns() _update_column_sizes() - - yield(get_tree().create_timer(0.5), "timeout") + + if is_echo: return + yield(get_tree().create_timer(0.25), "timeout") if get_node(path_table_root).get_child_count() == 0: - display_folder(folderpath, sort_by, sort_reverse, force_rebuild) + display_folder(folderpath, sort_by, sort_reverse, force_rebuild, true) else: emit_signal("grid_updated")