Bug 1079656 - Make the Loop Account menu item work after a restart. r=jaws

This commit is contained in:
Matthew Noorenberghe
2014-10-13 22:47:47 -07:00
parent 58db9abadc
commit cf93e853ee
2 changed files with 53 additions and 5 deletions

View File

@@ -1605,11 +1605,21 @@ this.MozLoopService = {
MozLoopServiceInternal.clearError("profile");
}),
openFxASettings: function() {
let url = new URL("/settings", gFxAOAuthClient.parameters.content_uri);
let win = Services.wm.getMostRecentWindow("navigator:browser");
win.switchToTabHavingURI(url.toString(), true);
},
openFxASettings: Task.async(function() {
try {
let fxAOAuthClient = yield MozLoopServiceInternal.promiseFxAOAuthClient();
if (!fxAOAuthClient) {
log.error("Could not get the OAuth client");
return;
}
let url = new URL("/settings", fxAOAuthClient.parameters.content_uri);
let win = Services.wm.getMostRecentWindow("navigator:browser");
win.switchToTabHavingURI(url.toString(), true);
} catch (ex) {
log.error("Error opening FxA settings", ex);
}
}),
/**
* Performs a hawk based request to the loop server.