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

Function togglePicks

packages/shared/src/features/patchy/PatchyMenu.tsx:293–315  ·  view source on GitHub ↗
(item: MenuItem)

Source from the content-addressed store, hash-verified

291 });
292
293 const togglePicks = (item: MenuItem) => {
294 if (!item.picks) {
295 return;
296 }
297 if (picks?.kind === item.picks) {
298 setPicks(null);
299 return;
300 }
301 log(item);
302 const excludeId = context.kind === 'post' ? context.post.id : undefined;
303 setPicks({
304 kind: item.picks,
305 posts: getPatchyQuickReads(client, {
306 limit: 3,
307 excludeId,
308 tag:
309 item.picks === 'tag' && context.kind === 'tag'
310 ? context.tag
311 : undefined,
312 isBookmarked: item.picks === 'bookmarks',
313 }),
314 });
315 };
316
317 return (
318 <nav aria-label="Ask Patchy" className="flex flex-col">

Callers 1

PatchyMenuFunction · 0.85

Calls 2

getPatchyQuickReadsFunction · 0.90
logFunction · 0.70

Tested by

no test coverage detected