Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.

Commit

Permalink
Merge pull request #212 from kogg/changes
Browse files Browse the repository at this point in the history
A few changes
  • Loading branch information
saiichihashimoto authored Sep 11, 2016
2 parents b5f8b46 + 34b9bb1 commit 80e9563
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"authors": [
"Cameron Rohani (https://twitter.com/cameronrohani)",
"Marco Marandiz (http://marcomarandiz.com/)",
"Saiichi Hashimoto (http://saiichihashimoto.com/)",
"Saiichi Hashimoto (http://saiichihashimoto.com/)"
],
"homepage": "http://hovercards.com",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion extension/set-uninstall-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ browser.storage.onChanged.addListener(function(changes, areaName) {
if (entry[0] !== 'user_id') {
return;
}
browser.runtime.setUninstallURL('http://' + (process.env.NODE_ENV === 'production' ? 'hover.cards' : 'localhost:5100') + '/track_uninstall?user_id=' + entry[1])
browser.runtime.setUninstallURL('http://' + (process.env.NODE_ENV === 'production' ? 'hover.cards' : 'localhost:5100') + '/track_uninstall?user_id=' + entry[1].newValue)
.catch(report.captureException);
});
});
Expand Down
26 changes: 26 additions & 0 deletions report/index.browser.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,36 @@
var _ = require('underscore');
var Raven = require('raven-js');

var browser = require('../extension/browser');

Raven
.config(process.env.SENTRY_DSN_CLIENT, {
environment: process.env.NODE_ENV,
release: process.env.npm_package_version
})
.install();

browser.storage.onChanged.addListener(function(changes, areaName) {
if (areaName !== 'sync') {
return;
}
_.pairs(changes).forEach(function(entry) {
if (entry[0] !== 'user_id') {
return;
}
Raven.setUserContext({ id: entry[1].newValue });
});
});

browser.storage.sync.get('user_id')
.then(_.property('user_id'))
.then(function(user_id) {
if (!user_id) {
return;
}

Raven.setUserContext({ id: user_id });
})
.catch(Raven.captureException);

module.exports = Raven;

0 comments on commit 80e9563

Please sign in to comment.