Skip to content

Commit

Permalink
fix removing ad banners
Browse files Browse the repository at this point in the history
  • Loading branch information
isstuev committed May 9, 2024
1 parent 42845ae commit fcb82bc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion jest/lib.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const PAGE_PROPS = {
cookies: '',
referrer: '',
query: {},
adBannerProvider: undefined,
adBannerProvider: null,
apiData: null,
};

Expand Down
2 changes: 1 addition & 1 deletion lib/contexts/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const AppContext = createContext<PageProps>({
cookies: '',
referrer: '',
query: {},
adBannerProvider: undefined,
adBannerProvider: null,
apiData: null,
});

Expand Down
6 changes: 3 additions & 3 deletions nextjs/getServerSideProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface Props<Pathname extends Route['pathname'] = never> {
query: Route['query'];
cookies: string;
referrer: string;
adBannerProvider: AdBannerProviders | undefined;
adBannerProvider: AdBannerProviders | null;
// if apiData is undefined, Next.js will complain that it is not serializable
// so we force it to be always present in the props but it can be null
apiData: metadata.ApiData<Pathname> | null;
Expand All @@ -32,15 +32,15 @@ Promise<GetServerSidePropsResult<Props<Pathname>>> => {
return adBannerFeature.provider;
}
}
return;
return null;
})();

return {
props: {
query,
cookies: req.headers.cookie || '',
referrer: req.headers.referer || '',
adBannerProvider,
adBannerProvider: adBannerProvider,
apiData: null,
},
};
Expand Down

0 comments on commit fcb82bc

Please sign in to comment.