1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-12 22:57:38 +02:00

CLI: Fixed shell mode

This commit is contained in:
Laurent Cozic
2017-12-07 18:12:46 +00:00
parent 37663bd110
commit ad6c347180
9 changed files with 98 additions and 29 deletions

View File

@ -66,10 +66,15 @@ class BaseApplication {
}
switchCurrentFolder(folder) {
this.dispatch({
type: 'FOLDER_SELECT',
id: folder ? folder.id : '',
});
if (!this.hasGui()) {
this.currentFolder_ = Object.assign({}, folder);
Setting.setValue('activeFolderId', folder ? folder.id : '');
} else {
this.dispatch({
type: 'FOLDER_SELECT',
id: folder ? folder.id : '',
});
}
}
// Handles the initial flags passed to main script and
@ -227,6 +232,10 @@ class BaseApplication {
return false;
}
uiType() {
return this.hasGui() ? 'gui' : 'cli';
}
generalMiddlewareFn() {
const middleware = store => next => (action) => {
return this.generalMiddleware(store, next, action);