1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Fixed state when switching folder

This commit is contained in:
Laurent Cozic 2017-10-21 18:01:02 +01:00
parent 2675a89dda
commit cc92c29913
2 changed files with 11 additions and 1 deletions

View File

@ -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);

View File

@ -10,7 +10,7 @@ class FolderListWidget extends ListWidget {
this.updateIndexFromSelectedFolderId_ = false;
this.itemRenderer = (item) => {
return item.title;
return item.title + ' ' + item.id;
};
}