mirror of
https://github.com/retorquere/zotero-better-bibtex.git
synced 2022-05-23 09:36:29 +03:00
pick up annotation changes
This commit is contained in:
@@ -664,7 +664,7 @@ notify('item-tag', (_action: any, _type: any, ids: any[], _extraData: any) => {
|
||||
|
||||
notify('item', (action: string, type: any, ids: any[], extraData: { [x: string]: { bbtCitekeyUpdate: any } }) => {
|
||||
// prevents update loop -- see KeyManager.init()
|
||||
log.debug('item', action, ids)
|
||||
// log.debug('item', action, ids, Zotero.Items.get(ids).map(item => Zotero.Utilities.Internal.itemToExportFormat(item))) // eslint-disable-line @typescript-eslint/no-unsafe-return
|
||||
if (action === 'modify') {
|
||||
ids = ids.filter((id: string | number) => !extraData[id] || !extraData[id].bbtCitekeyUpdate)
|
||||
if (!ids.length) return
|
||||
@@ -676,8 +676,14 @@ notify('item', (action: string, type: any, ids: any[], extraData: { [x: string]:
|
||||
// https://groups.google.com/forum/#!topic/zotero-dev/99wkhAk-jm0
|
||||
const parentIDs = []
|
||||
const items = action === 'delete' ? [] : Zotero.Items.get(ids).filter((item: ZoteroItem) => {
|
||||
if (typeof item.parentID !== 'boolean') {
|
||||
parentIDs.push(item.parentID)
|
||||
if (item.isAttachment() || item.isNote()) {
|
||||
const parentID = item.parentID
|
||||
if (typeof parentID === 'number') parentIDs.push(parentID)
|
||||
return false
|
||||
}
|
||||
if (item.isAnnotation()) {
|
||||
const parentID = item.parentItem?.parentID
|
||||
if (typeof parentID === 'number') parentIDs.push(parentID)
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
1
typings/global.d.ts
vendored
1
typings/global.d.ts
vendored
@@ -49,6 +49,7 @@ interface ZoteroItem {
|
||||
itemTypeID: number
|
||||
libraryID: number
|
||||
parentID: number
|
||||
parentItem?: ZoteroItem
|
||||
key: string
|
||||
getField: (name: string, unformatted?: boolean, includeBaseMapped?: boolean) => string | number
|
||||
setField: (name: string, value: string | number) => void
|
||||
|
||||
Reference in New Issue
Block a user