From 33b8da98af12b39a676a21b5a37dbec705e82465 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Wed, 30 Oct 2019 09:54:32 +0000 Subject: [PATCH] Clean up --- CliClient/app/command-tag.js | 9 ++++----- ElectronClient/app/gui/note-viewer/index.html | 2 -- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/CliClient/app/command-tag.js b/CliClient/app/command-tag.js index 62444ee65..cc79bb1cb 100644 --- a/CliClient/app/command-tag.js +++ b/CliClient/app/command-tag.js @@ -77,10 +77,9 @@ class Command extends BaseCommand { } } else if (command == 'notetags') { if (args.tag) { - let note = await app().loadItems(BaseModel.TYPE_NOTE, args.tag); - if (note.length < 1) throw new Error(_('Cannot find note with id "%s".', args.tag)); - if (note.length > 1) throw new Error(_('Multiple notes match the id "%s". Please be more specific', args.tag)); - let tags = await Tag.tagsByNoteId(note[0].id); + const note = await app().loadItem(BaseModel.TYPE_NOTE, args.tag); + if (!note) throw new Error(_('Cannot find "%s".', args.tag)); + const tags = await Tag.tagsByNoteId(note.id); tags.map(tag => { this.stdout(tag.title); }); @@ -88,7 +87,7 @@ class Command extends BaseCommand { throw new Error(_('Missing required argument: note')); } } else { - throw new Error(_('Invalid command: "%s"', command)); + throw new Error(_('Cannot find "%s".', '')); } } } diff --git a/ElectronClient/app/gui/note-viewer/index.html b/ElectronClient/app/gui/note-viewer/index.html index f5f85f4fe..3c9d1ada3 100644 --- a/ElectronClient/app/gui/note-viewer/index.html +++ b/ElectronClient/app/gui/note-viewer/index.html @@ -293,8 +293,6 @@ } contentElement.addEventListener('scroll', webviewLib.logEnabledEventHandler(e => { - console.info('contentElement.scroll', lastScrollEventTime); - // If the last scroll event was done by the user, lastScrollEventTime is set and // we can use that to skip the event handling. We skip it because in that case // the scroll position has already been updated. Also we add a 200ms interval