MCPcopy Create free account
hub / github.com/dailydotdev/apps / getPlusEntryData

Function getPlusEntryData

packages/shared/src/hooks/useBoot.ts:101–132  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

99
100 // This is only while its an experiment. If experiment succeeds, we can just get the variant in the usePlusEntry hook with getMarketingCta
101 const getPlusEntryData = () => {
102 const bootData = getBootData();
103
104 const plusEntryData = [
105 MarketingCtaVariant.PlusCard,
106 MarketingCtaVariant.PlusAnnouncementBar,
107 ].includes(bootData?.marketingCta?.variant);
108
109 if (plusEntryData) {
110 return bootData?.marketingCta;
111 }
112
113 if (
114 router.pathname?.includes('bookmarks') &&
115 bootData?.marketingCta?.variant === MarketingCtaVariant.PlusBookmarkTab
116 ) {
117 return bootData?.marketingCta;
118 }
119
120 const isForYouTab =
121 router.pathname === webappUrl ||
122 router.pathname === `${webappUrl}my-feed`;
123
124 if (
125 isForYouTab &&
126 bootData?.marketingCta?.variant === MarketingCtaVariant.PlusForYouTab
127 ) {
128 return bootData?.marketingCta;
129 }
130
131 return null;
132 };
133
134 const clearMarketingCta = (campaignId: string) => {
135 const bootData = getBootData();

Callers 1

usePlusEntryFunction · 0.85

Calls 1

getBootDataFunction · 0.70

Tested by

no test coverage detected