summaryrefslogtreecommitdiff
path: root/ext/js/comm
diff options
context:
space:
mode:
Diffstat (limited to 'ext/js/comm')
-rw-r--r--ext/js/comm/anki.js11
1 files changed, 5 insertions, 6 deletions
diff --git a/ext/js/comm/anki.js b/ext/js/comm/anki.js
index 251e0e0c..da234eff 100644
--- a/ext/js/comm/anki.js
+++ b/ext/js/comm/anki.js
@@ -15,6 +15,10 @@
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
+/* global
+ * AnkiUtil
+ */
+
class AnkiConnect {
constructor() {
this._enabled = false;
@@ -113,7 +117,7 @@ class AnkiConnect {
query = `"deck:${this._escapeQuery(note.deckName)}" `;
break;
case 'deck-root':
- query = `"deck:${this._escapeQuery(this.getRootDeckName(note.deckName))}" `;
+ query = `"deck:${this._escapeQuery(AnkiUtil.getRootDeckName(note.deckName))}" `;
break;
}
query += this._fieldsToQuery(note.fields);
@@ -138,11 +142,6 @@ class AnkiConnect {
return await this.findCards(`nid:${noteId}`);
}
- getRootDeckName(deckName) {
- const index = deckName.indexOf('::');
- return index >= 0 ? deckName.substring(0, index) : deckName;
- }
-
// Private
async _checkVersion() {