Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def _exception_handler(self, loop, context):
return

def __init__(self, config):
self._loading = False
self.config = config
self.workspaces = list(config['workspaces'].items())
self.store = Store(self.workspaces, self.config)
Expand All @@ -67,6 +68,7 @@ def __init__(self, config):
self.workspaces_line = None
else:
self.workspaces_line = Workspaces(self.workspaces)

self.columns = urwid.Columns([
('fixed', config['sidebar']['width'], urwid.AttrWrap(sidebar, 'sidebar')),
urwid.AttrWrap(chatbox, 'chatbox')
Expand All @@ -88,13 +90,14 @@ def start(self):
self.urwid_loop.run()

def switch_to_workspace(self, workspace_number):
self.sidebar = LoadingSideBar()
self.chatbox = LoadingChatBox('And it becomes worse!')
self._loading = True
self.message_box = None
self.store.switch_to_workspace(workspace_number)
loop.create_task(self.animate_loading())
loop.create_task(self.component_did_mount())
if not self._loading:
self._loading = True
self.sidebar = LoadingSideBar()
self.chatbox = LoadingChatBox('And it becomes worse!')
self.message_box = None
self.store.switch_to_workspace(workspace_number)
loop.create_task(self.animate_loading())
loop.create_task(self.component_did_mount())

@property
def sidebar(self):
Expand Down