Skip to content

Commit

Permalink
Add survey promo box
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Buck committed Sep 17, 2019
1 parent f4132e7 commit 7f247e2
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions packages/core/notification.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,29 @@ const pkgVersion = require('./package.json')
.slice(0, -1)
.join('.');

const showPromo = function(promoVersion) {
const lastpromoVersion = storage.get('promoVersion');

storage.set('promoVersion', promoVersion);

if (lastpromoVersion !== promoVersion) {
const body = `<div style="display: grid; grid-template-columns: 60px auto;">
<div>
<img width="40" src="https://octolinker.now.sh/static/octolinker-small.png">
</div>
<div>
We're super interested to learn what you think about <b>OctoLinker</b>!<br/>Please fill out this <a href="http://bit.ly/2lRJ7MB" target="_blank"><b>two questions</b></a> survey so that we can make it better!
</div>
</div>`;
showNotification({ body });
}
};

export default async function() {
const showUpdateNotification = storage.get('showUpdateNotification');

showPromo(2019);

if (!showUpdateNotification) {
return;
}
Expand Down

0 comments on commit 7f247e2

Please sign in to comment.