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 removing ad banners #1902

Merged
merged 1 commit into from
May 9, 2024
Merged
Show file tree
Hide file tree
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
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
Loading