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