Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
MuiseDestiny committed Apr 26, 2023
1 parent 9cfb1c9 commit 551cadf
Show file tree
Hide file tree
Showing 10 changed files with 867 additions and 226 deletions.
2 changes: 1 addition & 1 deletion addon/chrome/content/dist/assets/index.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
@@ -1,6 +1,6 @@
{
"name": "zotero-reference",
"version": "0.5.6",
"version": "0.5.7",
"description": "侧边栏展示阅读文献的所有参考文献,多源浮窗,推荐关联...",
"config": {
"addonName": "Zotero Reference",
Expand Down Expand Up @@ -55,7 +55,7 @@
"timers": "^0.1.1",
"vue": "^3.2.47",
"xml2js": "^0.4.23",
"zotero-plugin-toolkit": "^2.0.6"
"zotero-plugin-toolkit": "^2.1.3"
},
"devDependencies": {
"@types/node": "^18.13.0",
Expand Down
34 changes: 0 additions & 34 deletions src/addon.ts
Expand Up @@ -7,7 +7,6 @@ class Addon {
alive: boolean;
// Env type, see build.js
env: "development" | "production";
// ztoolkit: MyToolkit;
ztoolkit: ZoteroToolkit;
locale?: {
stringBundle: any;
Expand Down Expand Up @@ -35,38 +34,5 @@ class Addon {
}
}

/**
* Alternatively, import toolkit modules you use to minify the plugin size.
*
* Steps to replace the default `ztoolkit: ZoteroToolkit` with your `ztoolkit: MyToolkit`:
*
* 1. Uncomment this file's line 30: `ztoolkit: new MyToolkit(),`
* and comment line 31: `ztoolkit: new ZoteroToolkit(),`.
* 2. Uncomment this file's line 10: `ztoolkit: MyToolkit;` in this file
* and comment line 11: `ztoolkit: ZoteroToolkit;`.
* 3. Uncomment `./typing/global.d.ts` line 12: `declare const ztoolkit: import("../src/addon").MyToolkit;`
* and comment line 13: `declare const ztoolkit: import("zotero-plugin-toolkit").ZoteroToolkit;`.
*
* You can now add the modules under the `MyToolkit` class.
*/

import { BasicTool, unregister } from "zotero-plugin-toolkit/dist/basic";
import { UITool } from "zotero-plugin-toolkit/dist/tools/ui";
import { PreferencePaneManager } from "zotero-plugin-toolkit/dist/managers/preferencePane";

export class MyToolkit extends BasicTool {
UI: UITool;
PreferencePane: PreferencePaneManager;

constructor() {
super();
this.UI = new UITool(this);
this.PreferencePane = new PreferencePaneManager(this);
}

unregisterAll() {
unregister(this);
}
}

export default Addon;
4 changes: 2 additions & 2 deletions src/modules/api.ts
Expand Up @@ -438,8 +438,8 @@ class API {
body = { ..._body, ...body }

let response = await this.requests.post(api, body)
if (response) {
let data = response?.data?.list[0]
if (response && response?.data?.list?.[0]) {
let data = response?.data?.list?.[0]
// 验证DOI
if (doi) {
// 获取paperId的doi
Expand Down

0 comments on commit 551cadf

Please sign in to comment.