Skip to content

Commit

Permalink
starts but too many menu entries
Browse files Browse the repository at this point in the history
  • Loading branch information
retorquere committed Dec 30, 2023
1 parent 97102da commit f9102d9
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 17 deletions.
26 changes: 14 additions & 12 deletions bootstrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,24 +99,26 @@ export async function install(): Promise<void> {
export async function startup({ id, version, resourceURI, rootURI = resourceURI.spec }): Promise<void> {

Check warning on line 99 in bootstrap.ts

View workflow job for this annotation

GitHub Actions / release

Object pattern argument should be typed
await waitForZotero()

log('Starting')
try {
log('Starting')

// 'Services' may not be available in Zotero 6
if (typeof Services == 'undefined') {
// eslint-disable-next-line @typescript-eslint/no-shadow
var { Services } = ChromeUtils.import('resource://gre/modules/Services.jsm')
}
// 'Services' may not be available in Zotero 6
if (typeof Services == 'undefined') {
// eslint-disable-next-line @typescript-eslint/no-shadow
var { Services } = ChromeUtils.import('resource://gre/modules/Services.jsm')
}

// Read prefs from prefs.js when the plugin in Zotero 6
if (Zotero.platformMajorVersion < 102) { // eslint-disable-line @typescript-eslint/no-magic-numbers
setDefaultPrefs(rootURI)
}
// Read prefs from prefs.js when the plugin in Zotero 6
/*
if (Zotero.platformMajorVersion < 102) { // eslint-disable-line @typescript-eslint/no-magic-numbers
setDefaultPrefs(rootURI)
}
*/

// Add DOM elements to the main Zotero pane
try {
log('loading lib')
Services.scriptloader.loadSubScript(`${rootURI}lib.js`, { Zotero })
Zotero.EdTechHub.startup()
log('Started')
}
catch (err) {
log(`EdTechHub: startup error: ${err}`)
Expand Down
12 changes: 11 additions & 1 deletion lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ function debug(msg, err = null) {
}
else {
Zotero.debug(`EdTechHub: ${msg}`)

}
}

Expand Down Expand Up @@ -324,6 +323,17 @@ class EdTechHubMain {
}

async startup() {
try {
debug('starting...')
await this.start_up()
debug('started')
}
catch (err) {
debug('failed to start', err)
}
}

async start_up() {
const ready = Zotero.Promise.defer()
this.ready = ready.promise

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"name": "EdTechHub for Zotero",
"updateLink": "https://github.com/edtechhub/zotero-edtechhub/releases/download/v{version}/zotero-edtechhub-{version}.xpi",
"releaseURL": "https://github.com/edtechhub/zotero-edtechhub/releases/download/release/",
"iconURL": "chrome://zotero-edtechhub/skin/edtechhub.png"
"iconURL": "chrome://zotero-edtechhub/skin/edtechhub.png",
"bootstrapped": true
},
"devDependencies": {
"@fluent/syntax": "^0.19.0",
Expand Down
6 changes: 3 additions & 3 deletions zotero-plugin.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[profile]
name = BBTZ5TEST
path = ~/.BBTZ5TEST
name = BBTTEST
path = ~/.BBTTEST

[zotero]
log = ~/.BBTZ5TEST.log
log = ~/.BBTTEST.log
# db = zotero.sqlite

# [preferences]
Expand Down

0 comments on commit f9102d9

Please sign in to comment.