Fix "Filename" tab title option

https://forums.zotero.org/discussion/comment/441259/#Comment_441259
This commit is contained in:
Dan Stillman 2023-08-19 04:00:21 -04:00
parent b05ef8ed04
commit 3eef4284d1

View file

@ -544,8 +544,13 @@ class ReaderInstance {
let item = Zotero.Items.get(this._item.id);
let readerTitle = item.getDisplayTitle();
let parentItem = item.parentItem;
// If type is "filename", then readerTitle already has it
if (parentItem && type !== 'filename') {
if (type === 'filename') {
let attachment = await parentItem.getBestAttachment();
if (attachment && attachment.id === this._item.id) {
readerTitle = attachment.attachmentFilename;
}
}
else if (parentItem) {
let attachment = await parentItem.getBestAttachment();
if (attachment && attachment.id === this._item.id) {
let parts = [];