Skip to content

Commit

Permalink
Merge pull request #5600 from GeekyAnts/hotfix/usequery-resolver-web
Browse files Browse the repository at this point in the history
fix: use responsive query queryhash
  • Loading branch information
Viraj-10 authored Dec 7, 2022
2 parents 4598a0f + 90dd016 commit 5115434
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/utils/useResponsiveQuery/useResponsiveQuery.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ const getResponsiveStyles = (
queries: GetResponsiveStylesParams
): GetResponsiveStylesReturnType => {
const queryString = stableHash(queries.query);

const queriesHash = hash(queryString);

const styles = queries.initial
Expand Down Expand Up @@ -168,8 +169,13 @@ const getResponsiveStyles = (
});
if (mediaRules) {
const mediaQueryRule = getMediaQueryRule(queryRule, mediaRules);
insert(`/*${queryHash}{}*/${mediaQueryRule}`);
textContentMap[`/*${queryHash}{}*/${mediaQueryRule}`] = true;

const queryKey = `/*${queryHash}{}*/${mediaQueryRule}`;

if (!textContentMap[queryKey]) {
insert(queryKey);
textContentMap[queryKey] = true;
}
}
}
});
Expand Down

0 comments on commit 5115434

Please sign in to comment.