Skip to content

Commit

Permalink
Release 1.0.0-3
Browse files Browse the repository at this point in the history
  • Loading branch information
windingwind committed Sep 7, 2023
1 parent 452fb91 commit 51d04da
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zotero-tag",
"version": "1.0.0-2",
"version": "1.0.0-3",
"description": "Action it, tag it, sorted.",
"config": {
"addonName": "Actions and Tags for Zotero",
Expand Down
10 changes: 5 additions & 5 deletions src/modules/notify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function initNotifierObserver() {
event: string,
type: string,
ids: number[] | string[],
extraData: { [key: string]: any }
extraData: { [key: string]: any },
) => {
if (!addon?.data.alive) {
Zotero.Notifier.unregisterObserver(notifierID);
Expand All @@ -35,13 +35,13 @@ async function onNotify(
event: string,
type: string,
ids: Array<string | number>,
extraData: { [key: string]: any }
extraData: { [key: string]: any },
) {
// You can add your code to the corresponding notify type
ztoolkit.log("notify", event, type, ids, extraData);
if (event === "open" && type === "file") {
const parentItems = Zotero.Items.getTopLevel(
Zotero.Items.get(ids as number[])
Zotero.Items.get(ids as number[]),
);
for (const item of parentItems) {
await addon.api.dispatchRuleEvents(TagEventTypes.openFile, {
Expand All @@ -52,7 +52,7 @@ async function onNotify(
}
if (event === "add" && type === "item") {
const items = Zotero.Items.get(ids as number[]).filter(
(item) => !(item instanceof Zotero.FeedItem)
(item) => !(item instanceof Zotero.FeedItem),
);
for (const item of items) {
if (item.isRegularItem()) {
Expand Down Expand Up @@ -88,7 +88,7 @@ async function onNotify(
.map((id) => addon.data.tabStatus.get(id as string))
.filter((id) => id);
const parentItems = Zotero.Items.getTopLevel(
Zotero.Items.get(itemIDs as number[])
Zotero.Items.get(itemIDs as number[]),
);
for (const item of parentItems) {
await addon.api.dispatchRuleEvents(TagEventTypes.closeTab, {
Expand Down

0 comments on commit 51d04da

Please sign in to comment.