Update logged data name to dictionaryEntry (#1590)

This commit is contained in:
toasted-nutbread 2021-04-03 15:23:55 -04:00 committed by GitHub
parent 4d5db960d2
commit 8de1e9b3d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1867,14 +1867,14 @@ class Display extends EventDispatcher {
async _logDefinitionData(index) { async _logDefinitionData(index) {
if (index < 0 || index >= this._definitions.length) { return; } if (index < 0 || index >= this._definitions.length) { return; }
const definition = this._definitions[index]; const dictionaryEntry = this._definitions[index];
let ankiNoteData; let ankiNoteData;
let ankiNoteDataException; let ankiNoteDataException;
try { try {
const context = this._getNoteContext(); const context = this._getNoteContext();
const {general: {resultOutputMode, glossaryLayoutMode, compactTags}} = this._options; const {general: {resultOutputMode, glossaryLayoutMode, compactTags}} = this._options;
ankiNoteData = await this._ankiNoteBuilder.getRenderingData({ ankiNoteData = await this._ankiNoteBuilder.getRenderingData({
definition, definition: dictionaryEntry,
mode: 'test', mode: 'test',
context, context,
resultOutputMode, resultOutputMode,
@ -1886,7 +1886,7 @@ class Display extends EventDispatcher {
} catch (e) { } catch (e) {
ankiNoteDataException = e; ankiNoteDataException = e;
} }
const result = {definition, ankiNoteData}; const result = {dictionaryEntry, ankiNoteData};
if (typeof ankiNoteDataException !== 'undefined') { if (typeof ankiNoteDataException !== 'undefined') {
result.ankiNoteDataException = ankiNoteDataException; result.ankiNoteDataException = ankiNoteDataException;
} }