Prevent refreshing having influence on the card

master
Kuba Orlik 3 years ago
parent e473c4dce3
commit 1d4e35cee4

@ -36,7 +36,16 @@ module.exports = function (id, card) {
}
</style>
<img id="track" style="opacity:0" />
<body>
<h1>Twoja karta to:</h1>
<div id="card">${getEmoji(card)}</div>
<script>
(function () {
if (localStorage.getItem("card")) {
card.innerHTML = localStorage.getItem("card");
return;
}
localStorage.setItem("card", \`${getEmoji(card)}\`);
track.src = \`/track?id=${id}&DNT=\${navigator.doNotTrack}&lang=\${
navigator.language
}&res=\${
@ -44,10 +53,8 @@ module.exports = function (id, card) {
}&appCodeName=\${navigator.appCodeName}&appVersion=\${
navigator.appVersion
}&platform=\${navigator.platform}\`;
})();
</script>
<body>
<h1>Twoja karta to:</h1>
<div>${getEmoji(card)}</div>
</body>
</html> `;
};

Loading…
Cancel
Save