Skip to content

Commit

Permalink
feat(pacer): Update logic to remove banner from login page
Browse files Browse the repository at this point in the history
  • Loading branch information
ERosendo committed Jul 12, 2024
1 parent 634ec94 commit a55d0c1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ async function addRecapInformation(msg) {

let learn_more_btn = document.getElementById('learn_more_btn');
learn_more_btn.addEventListener('click', async () => {
await PACER.removeBannerFromLoginPage();
await PACER.removeBannerFromLoginPage(event_from_btn = true);
return true;
});

Expand Down
8 changes: 6 additions & 2 deletions src/pacer.js
Original file line number Diff line number Diff line change
Expand Up @@ -794,13 +794,17 @@ let PACER = {
headerContainer.after(banner_div);
},

removeBannerFromLoginPage: async () => {
removeBannerFromLoginPage: async (event_from_btn = false) => {
// Updates user preferences and remove the information banner
let info_banner = document.getElementById('recap_info_banner');
info_banner.remove();

let options = await getItemsFromStorage('options');
options['dismiss_class_action_info'] = true;
if (event_from_btn) {
options['option_dismiss_new_brand_info'] = true;
options['dismiss_news_badge'] = true;
}
options['login_dismiss_new_brand_info'] = true;
saveItemToStorage({ options: options });
},

Expand Down

0 comments on commit a55d0c1

Please sign in to comment.