Fixed state saving issues
This commit is contained in:
@@ -595,8 +595,8 @@ class SublimeMusicApp(Gtk.Application):
|
||||
self.state.save_config()
|
||||
|
||||
def on_connected_server_changed(self, action, current_server):
|
||||
self.state.save()
|
||||
self.state.config.current_server = current_server
|
||||
self.state.save()
|
||||
self.state.save_config()
|
||||
|
||||
self.reset_state()
|
||||
|
@@ -330,7 +330,6 @@ class CacheManager(metaclass=Singleton):
|
||||
for x in meta_json.get(name, [])
|
||||
]
|
||||
elif default == dict:
|
||||
print('dict', name)
|
||||
self.cache[name] = {
|
||||
id: type_name.from_json(x)
|
||||
for id, x in meta_json.get(name, {}).items()
|
||||
|
@@ -92,6 +92,7 @@ class AppConfiguration:
|
||||
|
||||
@property
|
||||
def server(self) -> Optional[ServerConfiguration]:
|
||||
return (
|
||||
None if self.current_server < 0 or len(self.servers) < 1 else
|
||||
self.servers[self.current_server])
|
||||
if 0 <= self.current_server < len(self.servers):
|
||||
return self.servers[self.current_server]
|
||||
|
||||
return None
|
||||
|
@@ -58,7 +58,7 @@ class BrowsePanel(Gtk.Overlay):
|
||||
def update(self, state: ApplicationState, force=False):
|
||||
id_stack = []
|
||||
# TODO make async
|
||||
if CacheManager.ready:
|
||||
if CacheManager.ready and state.selected_browse_element_id is not None:
|
||||
directory = None
|
||||
current_dir_id = state.selected_browse_element_id
|
||||
while directory is None or directory.parent is not None:
|
||||
|
Reference in New Issue
Block a user