Skip to content
This repository was archived by the owner on Oct 10, 2024. It is now read-only.

Commit bbb9393

Browse files
authored
Merge pull request #93 from pypeclub/bugfix/library_refresh
fix library loader refresh button
2 parents e7e9d7e + 025a325 commit bbb9393

File tree

1 file changed

+7
-1
lines changed
  • avalon/tools/libraryloader

1 file changed

+7
-1
lines changed

avalon/tools/libraryloader/app.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,11 @@ def __init__(
141141
self.resize(1330, 700)
142142

143143
def on_refresh_clicked(self):
144-
self._set_projects()
144+
assets_widget = self.data["widgets"]["assets"]
145+
with tools_lib.preserve_states(
146+
assets_widget.view, column=0, role=assets_widget.model.ObjectIdRole
147+
):
148+
self._set_projects()
145149

146150
def _set_projects(self, default=False):
147151
projects = self.get_filtered_projects()
@@ -181,6 +185,8 @@ def get_filtered_projects(self):
181185
def on_project_change(self):
182186
projects = self.get_filtered_projects()
183187
project_name = self.combo_projects.currentText()
188+
if not project_name:
189+
return
184190
self.dbcon.activate_project(project_name)
185191

186192
_config = lib.find_config(self.dbcon)

0 commit comments

Comments
 (0)