1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-03-27 22:53:33 +01:00

Work around some conceivable race conditions in one of my least favorite commits ever.

This commit is contained in:
Kris Maglione
2011-02-14 17:41:25 -05:00
parent baa296527e
commit 0f8116aea1
3 changed files with 64 additions and 32 deletions

View File

@@ -56,17 +56,18 @@ var ConfigBase = Class("ConfigBase", {
get addonID() this.name + "@dactyl.googlecode.com",
addon: Class.memoize(function () {
let addon;
util.waitFor(function () {
do {
addon = services.fuel.storage.get("dactyl.bootstrap", {}).addon;
if (addon && !addon.getResourceURI)
if (addon && !addon.getResourceURI) {
util.reportError(Error("Don't have add-on yet"));
return !addon || addon.getResourceURI;
});
yield 10;
}
}
while (addon && !addon.getResourceURI);
if (!addon)
addon = require("addons").AddonManager.getAddonByID(this.addonID);
return addon;
yield addon;
}, true),
/**