Skip to content

Commit de25006

Browse files
committed
not using frame filtered cookies for exemption reason
1 parent 0af9bb1 commit de25006

File tree

2 files changed

+9
-15
lines changed
  • packages

2 files changed

+9
-15
lines changed

packages/design-system/src/components/table/utils/precalculatedFiltersUtils/calculateExemptionReasons.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ import { TableFilter } from '../../useTable';
2424

2525
/**
2626
* This function will return set of non duplicated cookie execmption reason.
27-
* @param frameFilteredCookies The cookie table data.
27+
* @param cookies The cookie table data.
2828
* @param clearQuery Function to clear the query(when options are provided) to avoid conflicts.
2929
* @param options Options to preselect the filter values.
3030
* @returns {string[]} Unique set of exemption reasons.
3131
*/
3232
function frameOnlyExemptionReasonValues(
33-
frameFilteredCookies: CookieTableData[],
33+
cookies: CookieTableData[],
3434
clearQuery?: () => void,
3535
options?: string[]
3636
) {
3737
const collectedExemptionReasons = Array.from(
3838
new Set(
39-
frameFilteredCookies.map(({ exemptionReason }) => {
39+
cookies.map(({ exemptionReason }) => {
4040
if (!exemptionReason || exemptionReason.toLowerCase() === 'none') {
4141
return null;
4242
}

packages/extension/src/view/devtools/components/cookies/cookiesListing/useCookieListing/index.tsx

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import {
2222
type CookieTableData,
2323
type TabCookies,
2424
BLOCK_STATUS,
25-
filterCookiesByFrame,
2625
} from '@ps-analysis-tool/common';
2726
import {
2827
RefreshButton,
@@ -49,13 +48,13 @@ import NamePrefixIconSelector from './namePrefixIconSelector';
4948
import OrphanedUnMappedInfoDisplay from './orphanedUnMappedInfoDisplay';
5049

5150
const useCookieListing = (domainsInAllowList: Set<string>) => {
52-
const { selectedFrame, cookies, getCookiesSetByJavascript, tabFrames } =
53-
useCookie(({ state, actions }) => ({
51+
const { selectedFrame, cookies, getCookiesSetByJavascript } = useCookie(
52+
({ state, actions }) => ({
5453
selectedFrame: state.selectedFrame,
5554
cookies: state.tabCookies || {},
56-
tabFrames: state.tabFrames,
5755
getCookiesSetByJavascript: actions.getCookiesSetByJavascript,
58-
}));
56+
})
57+
);
5958

6059
const { activePanelQuery, clearActivePanelQuery } = useSidebar(
6160
({ state }) => ({
@@ -64,11 +63,6 @@ const useCookieListing = (domainsInAllowList: Set<string>) => {
6463
})
6564
);
6665

67-
const frameFilteredCookies = useMemo(
68-
() => filterCookiesByFrame(cookies, tabFrames, selectedFrame),
69-
[cookies, selectedFrame, tabFrames]
70-
);
71-
7266
const parsedQuery = useMemo(
7367
() => JSON.parse(activePanelQuery || '{}'),
7468
[activePanelQuery]
@@ -498,7 +492,7 @@ const useCookieListing = (domainsInAllowList: Set<string>) => {
498492
parsedQuery
499493
),
500494
filterValues: calculateExemptionReason(
501-
frameFilteredCookies,
495+
Object.values(cookies),
502496
clearActivePanelQuery,
503497
parsedQuery?.filter?.exemptionReason
504498
),
@@ -509,7 +503,7 @@ const useCookieListing = (domainsInAllowList: Set<string>) => {
509503
useGenericPersistenceKey: true,
510504
},
511505
}),
512-
[clearActivePanelQuery, cookies, frameFilteredCookies, parsedQuery]
506+
[clearActivePanelQuery, cookies, parsedQuery]
513507
);
514508

515509
const searchKeys = useMemo<string[]>(

0 commit comments

Comments
 (0)