Fix missing title in PDF reader standalone window

This commit is contained in:
Martynas Bagdonas 2021-05-21 16:01:43 +03:00
parent eb085f2bbe
commit b2acb5e339

View file

@ -56,6 +56,7 @@ class ReaderInstance {
}
this.state = state;
this._itemID = item.id;
// Set `ReaderTab` title as fast as possible
this.updateTitle();
let path = await item.getFilePathAsync();
let buf = await OS.File.read(path, {});
@ -77,6 +78,8 @@ class ReaderInstance {
bottomPlaceholderHeight: this._bottomPlaceholderHeight,
localizedStrings: Zotero.Intl.getPrefixedStrings('pdfReader')
}, [buf]);
// Set title once again, because `ReaderWindow` isn't loaded the first time
this.updateTitle();
return true;
}