Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix Perceptor tab refresh preblom #864

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/pages/ContentScripts/features/perceptor-tab/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,10 @@ const addPerceptorTab = async (): Promise<void | false> => {
perceptorTab.href = perceptorHref;
perceptorTab.id = featureId;
perceptorTab.setAttribute('data-tab-item', featureId);

perceptorTab.setAttribute(
'data-analytics-event',
`{"category":"Underline navbar","action":"Click tab","label":"Perceptor","target":"UNDERLINE_NAV.TAB"}`
);
const perceptorTitle = $('[data-content]', perceptorTab);
perceptorTitle.text('Perceptor').attr('data-content', 'Perceptor');

Expand Down Expand Up @@ -69,6 +72,13 @@ const updatePerceptorTabHighlighting = async (): Promise<void> => {
// no operation needed
if (!isPerceptor()) return;
// if perceptor tab
if (insightsTab.hasClass('selected')) {
insightsTab.removeClass('selected');
insightsTab.removeAttr('aria-current');
perceptorTab.attr('aria-current', 'page');
perceptorTab.addClass('selected');
}

const insightsTabSeletedLinks = insightsTab.attr('data-selected-links');
insightsTab.removeAttr('data-selected-links');
perceptorTab.attr('data-selected-links', 'pulse');
Expand Down
Loading