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

minor changes

This commit is contained in:
Laurent Cozic 2017-06-29 22:04:11 +01:00
parent 5f6db113cf
commit 46cd64b08b
3 changed files with 9 additions and 3 deletions

View File

@ -146,7 +146,7 @@ function importEnex(parentFolderId, filePath, importOptions = null) {
let processingNotes = false;
stream.on('error', (error) => {
importOptions.onError(error);
reject(new Error(error.toString()));
});
function currentNodeName() {

View File

@ -346,6 +346,7 @@ commands.push({
['--fuzzy-matching', 'For debugging purposes. Do not use.'],
],
action: async function(args, end) {
let redrawnCalled = false;
try {
let filePath = args.file;
let folder = null;
@ -384,7 +385,6 @@ commands.push({
return;
}
let redrawnCalled = false;
let options = {
fuzzyMatching: args.options['fuzzy-matching'] === true,
onProgress: (progressState) => {
@ -398,6 +398,7 @@ commands.push({
vorpal.ui.redraw(line.join(' '));
},
onError: (error) => {
if (redrawnCalled) vorpal.ui.redraw.done();
let s = error.trace ? error.trace : error.toString();
this.log(s);
},
@ -406,12 +407,13 @@ commands.push({
folder = !folder ? await Folder.save({ title: folderTitle }) : folder;
this.log(_('Importing notes...'));
await importEnex(folder.id, filePath, options);
if (redrawnCalled) vorpal.ui.redraw.done();
this.log(_('Done.'));
} catch (error) {
this.log(error);
}
if (redrawnCalled) vorpal.ui.redraw.done();
end();
},
});

View File

@ -232,6 +232,8 @@ class OneDriveApi {
if (!r.ok) {
errorMessage = 'Could not retrieve auth code: ' + r.status + ': ' + r.statusText;
writeResponse(400, errorMessage);
targetConsole.log('');
targetConsole.log(errorMessage);
server.destroy();
return;
}
@ -239,6 +241,8 @@ class OneDriveApi {
return r.json().then((json) => {
this.auth_ = json;
writeResponse(200, 'The application has been authorised - you may now close this browser tab.');
targetConsole.log('');
targetConsole.log('The application has been successfully authorised.');
server.destroy();
});
});