From 5a743505528cc2cc96ab6bf41a7460c75f6c084c Mon Sep 17 00:00:00 2001 From: toasted-nutbread Date: Mon, 9 Dec 2019 21:29:48 -0500 Subject: [PATCH] Move apiNoteView implementation into Backend --- ext/bg/js/api.js | 4 ++-- ext/bg/js/backend.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ext/bg/js/api.js b/ext/bg/js/api.js index 497d81bf..9de1fb4b 100644 --- a/ext/bg/js/api.js +++ b/ext/bg/js/api.js @@ -57,8 +57,8 @@ function apiDefinitionsAddable(definitions, modes, optionsContext) { return utilBackend()._onApiDefinitionsAddable({definitions, modes, optionsContext}); } -async function apiNoteView(noteId) { - return utilBackend().anki.guiBrowse(`nid:${noteId}`); +function apiNoteView(noteId) { + return utilBackend()._onApiNoteView({noteId}); } async function apiTemplateRender(template, data, dynamic) { diff --git a/ext/bg/js/backend.js b/ext/bg/js/backend.js index 77dc0d33..4db88365 100644 --- a/ext/bg/js/backend.js +++ b/ext/bg/js/backend.js @@ -385,8 +385,8 @@ class Backend { return states; } - _onApiNoteView({noteId}) { - return apiNoteView(noteId); + async _onApiNoteView({noteId}) { + return this.anki.guiBrowse(`nid:${noteId}`); } _onApiTemplateRender({template, data, dynamic}) {