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

Loading…
Cancel
Save