From cc92c299134ce9c7e6aa95f535950a45a2e285f2 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Sat, 21 Oct 2017 18:01:02 +0100 Subject: [PATCH] Fixed state when switching folder --- CliClient/app/app.js | 10 ++++++++++ CliClient/app/gui/FolderListWidget.js | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CliClient/app/app.js b/CliClient/app/app.js index 2e10089cd..62513f207 100644 --- a/CliClient/app/app.js +++ b/CliClient/app/app.js @@ -67,8 +67,14 @@ class Application { } switchCurrentFolder(folder) { + this.logger().info('SWITCHING TO ' + (folder ? folder.id : '')); this.currentFolder_ = folder; Setting.setValue('activeFolderId', folder ? folder.id : ''); + + this.dispatch({ + type: 'FOLDERS_SELECT', + folderId: folder ? folder.id : '', + }); } async guessTypeAndLoadItem(pattern, options = null) { @@ -464,6 +470,10 @@ class Application { return middleware; } + dispatch(action) { + if (this.store()) return this.store().dispatch(action); + } + async start() { let argv = process.argv; let startFlags = await this.handleStartFlags_(argv); diff --git a/CliClient/app/gui/FolderListWidget.js b/CliClient/app/gui/FolderListWidget.js index f8751c493..d0429bbe0 100644 --- a/CliClient/app/gui/FolderListWidget.js +++ b/CliClient/app/gui/FolderListWidget.js @@ -10,7 +10,7 @@ class FolderListWidget extends ListWidget { this.updateIndexFromSelectedFolderId_ = false; this.itemRenderer = (item) => { - return item.title; + return item.title + ' ' + item.id; }; }