Hiding review reminder once store link is clicked

pull/148/head
Kevin Payravi 2023-04-27 01:53:24 -04:00
parent 047afc323a
commit 599e863346
2 changed files with 12 additions and 6 deletions

View File

@ -283,13 +283,13 @@
<div id="notificationBanner">
Enjoying Indie Wiki Buddy? Please leave a review!
<br />
<a target="_blank" href="https://chrome.google.com/webstore/detail/indie-wiki-buddy/fkagelmloambgokoeokbpihmgpkbgbfm">Chrome</a>
<a id="reviewReminderChromeLink" target="_blank" href="https://chrome.google.com/webstore/detail/indie-wiki-buddy/fkagelmloambgokoeokbpihmgpkbgbfm">Chrome</a>
&nbsp;&nbsp;|&nbsp;&nbsp;
<a target="_blank" href="https://addons.mozilla.org/en-US/firefox/addon/indie-wiki-buddy/">Firefox</a>
<a id="reviewReminderFirefoxLink" target="_blank" href="https://addons.mozilla.org/en-US/firefox/addon/indie-wiki-buddy/">Firefox</a>
&nbsp;&nbsp;|&nbsp;&nbsp;
<a id="hideReviewReminderLink" href="#">Hide this message</a>
<a id="reviewReminderHideLink" href="#">Hide this message</a>
<br /><br />
Having issues or ideas for improvement? Please <a href="https://getindie.wiki/#contact">contact me</a>!
Having issues or ideas for improvement? Please <a target="_blank" href="https://getindie.wiki/#contact">contact me</a>!
</div>
<div id="content">
<h2>Global settings</h2>

View File

@ -456,8 +456,14 @@ document.addEventListener('DOMContentLoaded', function () {
if (!item.hideReviewReminder && ((countSettingsOpened - 1) % 5 === 0)) {
document.getElementById('notificationBanner').style.display = 'block';
// Hide review reminder if user clicks 'hide' link:
document.getElementById('hideReviewReminderLink').addEventListener('click', function () {
// Disable future review reminders if user clicks links:
document.getElementById('reviewReminderChromeLink').addEventListener('click', function () {
chrome.storage.local.set({ 'hideReviewReminder': true });
});
document.getElementById('reviewReminderFirefoxLink').addEventListener('click', function () {
chrome.storage.local.set({ 'hideReviewReminder': true });
});
document.getElementById('reviewReminderHideLink').addEventListener('click', function () {
chrome.storage.local.set({ 'hideReviewReminder': true });
document.getElementById('notificationBanner').style.display = 'none';
});