Fix DisplayGenerator not working on pitch-accents-preview.html (#1276)

This commit is contained in:
toasted-nutbread 2021-01-19 20:48:10 -05:00 committed by GitHub
parent 21fce9f3d9
commit 3c51bf2a0b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -22,7 +22,7 @@
*/
class DisplayGenerator {
constructor({japaneseUtil, mediaLoader, hotkeyHelpController}) {
constructor({japaneseUtil, mediaLoader, hotkeyHelpController=null}) {
this._japaneseUtil = japaneseUtil;
this._mediaLoader = mediaLoader;
this._hotkeyHelpController = hotkeyHelpController;
@ -38,6 +38,7 @@ class DisplayGenerator {
updateHotkeys() {
const hotkeyHelpController = this._hotkeyHelpController;
if (hotkeyHelpController === null) { return; }
for (const template of this._templates.getAllTemplates()) {
hotkeyHelpController.setupNode(template.content);
}