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

Function getControlMeta

packages/shared/src/features/feedExplain/describe.ts:370–385  ·  view source on GitHub ↗
(
  control: FeedControl<Mode> | undefined,
  isPlus: boolean,
  modeMeta: Partial<Record<string, SignalMeta>> = topicModeMeta,
)

Source from the content-addressed store, hash-verified

368 * exact boost only counts while the reader has Plus.
369 */
370export const getControlMeta = <Mode extends string>(
371 control: FeedControl<Mode> | undefined,
372 isPlus: boolean,
373 modeMeta: Partial<Record<string, SignalMeta>> = topicModeMeta,
374): SignalMeta | undefined => {
375 if (!control) {
376 return undefined;
377 }
378 if (!control.mode && !isPlus) {
379 return pausedWeightMeta;
380 }
381 const meta = (control.mode && modeMeta[control.mode]) || exactWeightMeta;
382 return control.expiresAt
383 ? { ...meta, text: `${meta.text} ${formatUntil(control.expiresAt)}` }
384 : meta;
385};
386
387const getSideFactor = (
388 explain: FeedItemExplain | null | undefined,

Callers 10

TopicsTabFunction · 0.90
SourcesTabFunction · 0.90
FeedExplanationModalFunction · 0.90
SourceListFunction · 0.90
CreatorListFunction · 0.90
getTopicMetaFunction · 0.90
SignalRowFunction · 0.90
AuthorSignalRowFunction · 0.90
renderRowFunction · 0.90
getTimedChangesFunction · 0.90

Calls 1

formatUntilFunction · 0.90

Tested by

no test coverage detected