Skip to content

Commit

Permalink
growl error catching
Browse files Browse the repository at this point in the history
  • Loading branch information
carbureted committed May 14, 2014
1 parent 6d11c5f commit 5230968
Showing 1 changed file with 26 additions and 21 deletions.
Expand Up @@ -745,30 +745,35 @@ if (options.firstBuild > 71) {
var currentDate = moment();
var lastShown = options.lastShown || moment();

if (pwyw.bucket == 'viewed-cream') {
if (currentDate > installDate.clone().add('days', 3)) {
options.pwyw = JSON.stringify({date: date, bucket: 'viewed-cream-1'});
options.lastShown = moment();
clearBadge();
dispatchBubble(
'Just a quick reminder that Disconnect is pay-what-you-want software. Please make a payment today!',
'',
'https://disconnect.me/welcome/paysomething-1'
);
try {
if (pwyw.bucket == 'viewed-cream') {
if (currentDate > installDate.clone().add('days', 3)) {
options.pwyw = JSON.stringify({date: date, bucket: 'viewed-cream-1'});
options.lastShown = moment();
clearBadge();
dispatchBubble(
'Just a quick reminder that Disconnect is pay-what-you-want software. Please make a payment today!',
'',
'https://disconnect.me/welcome/paysomething-1'
);
}
}
}
else if (pwyw.bucket == 'viewed-cream-1') {
if (currentDate > installDate.clone().add('days', 10)) {
options.pwyw = JSON.stringify({date: date, bucket: 'viewed-cream-2'});
options.lastShown = moment();
clearBadge();
dispatchBubble(
'We hope you’re enjoying Disconnect! We rely on your support. Please make a payment today!',
'',
'https://disconnect.me/welcome/paysomething-2'
);
else if (pwyw.bucket == 'viewed-cream-1') {
if (currentDate > installDate.clone().add('days', 10)) {
options.pwyw = JSON.stringify({date: date, bucket: 'viewed-cream-2'});
options.lastShown = moment();
clearBadge();
dispatchBubble(
'We hope you’re enjoying Disconnect! We rely on your support. Please make a payment today!',
'',
'https://disconnect.me/welcome/paysomething-2'
);
}
}
}
catch(e) {
pingURL('https://disconnect.me/error/d2/creamGrowlError');
}

setInterval(function() {
if (!(options.installDate)) {
Expand Down

0 comments on commit 5230968

Please sign in to comment.