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

Function getVariables

packages/shared/src/components/MainFeedLayout.tsx:743–773  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

741 }
742
743 const getVariables = () => {
744 if (
745 isUpvoted ||
746 feedWithDateRange.includes(tab) ||
747 feedWithDateRange.includes(urlToTab[router.pathname])
748 ) {
749 return { ...config.variables, period: periods[selectedPeriod].value };
750 }
751
752 if (isAnyExplore) {
753 const laptopValue =
754 tab === ExploreTabs.ByDate || isExploreLatest ? 1 : 0;
755 const mobileValue =
756 urlToTab[router.pathname] === ExploreTabs.ByDate ? 1 : 0;
757 const finalAlgo = isLaptop ? laptopValue : mobileValue;
758
759 return {
760 ...config.variables,
761 ranking: algorithms[finalAlgo].value,
762 };
763 }
764
765 if (isSortableFeed) {
766 return {
767 ...config.variables,
768 ranking: algorithms[selectedAlgo].value,
769 };
770 }
771
772 return config.variables;
773 };
774
775 // The draft goes last, so the feed's own key is this one without it.
776 const feedVariables = getVariables();

Callers 1

MainFeedLayoutFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected