fix context type inconsistencies

This commit is contained in:
siikamiika 2019-11-29 01:36:14 +02:00
parent 71a117c267
commit 8a94d186c3

View File

@ -80,7 +80,6 @@ class Display {
}) })
} }
}, },
type: 'kanji',
sentence: this.context.sentence, sentence: this.context.sentence,
url: this.context.url url: this.context.url
}; };
@ -132,7 +131,6 @@ class Display {
}) })
} }
}, },
type: 'terms',
disableScroll, disableScroll,
sentence, sentence,
url: this.context.url url: this.context.url
@ -361,6 +359,7 @@ class Display {
} }
this.definitions = definitions; this.definitions = definitions;
context.type = 'terms';
this.context = context; this.context = context;
const sequence = ++this.sequence; const sequence = ++this.sequence;
@ -421,6 +420,7 @@ class Display {
} }
this.definitions = definitions; this.definitions = definitions;
context.type = 'kanji';
this.context = context; this.context = context;
const sequence = ++this.sequence; const sequence = ++this.sequence;
@ -548,16 +548,16 @@ class Display {
}) })
} }
}); });
const {type, details} = this.context.source; const {details} = this.context.source;
this.setContent(type, details); this.setContent(details.context.type, details);
} }
poppedTermView() { poppedTermView() {
if (this.poppedContextHistory.length === 0) { return; } if (this.poppedContextHistory.length === 0) { return; }
this.context.index = this.index; this.context.index = this.index;
this.context.scroll = this.windowScroll.y; this.context.scroll = this.windowScroll.y;
const {type, details} = this.poppedContextHistory.pop(); const {details} = this.poppedContextHistory.pop();
this.setContent(type, details); this.setContent(details.context.type, details);
} }
noteTryAdd(mode) { noteTryAdd(mode) {