mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-02-24 23:45:47 +01:00
Fix config.addon race and add guards against future breakage.
This commit is contained in:
@@ -53,7 +53,15 @@ var ConfigBase = Class("ConfigBase", {
|
||||
|
||||
get addonID() this.name + "@dactyl.googlecode.com",
|
||||
addon: Class.memoize(function () {
|
||||
let addon = services.fuel.storage.get("dactyl.bootstrap", {}).addon;
|
||||
let addon;
|
||||
util.waitFor(function () {
|
||||
addon = services.fuel.storage.get("dactyl.bootstrap", {}).addon;
|
||||
if (addon && !addon.getResourceURI)
|
||||
util.reportError(Error("Don't have add-on yet"));
|
||||
|
||||
return !addon || addon.getResourceURI();
|
||||
});
|
||||
|
||||
if (!addon)
|
||||
addon = require("addons").AddonManager.getAddonByID(this.addonID);
|
||||
return addon;
|
||||
|
||||
Reference in New Issue
Block a user