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

Function setPostHiddenPanel

packages/shared/src/hooks/post/useBlockPostPanel.ts:84–98  ·  view source on GitHub ↗
(
  client: QueryClient,
  user: Pick<LoggedUser, 'id'> | undefined,
  postId: string,
  isHidden: boolean,
)

Source from the content-addressed store, hash-verified

82 * does: a hidden card turns into its hidden panel.
83 */
84export const setPostHiddenPanel = (
85 client: QueryClient,
86 user: Pick<LoggedUser, 'id'> | undefined,
87 postId: string,
88 isHidden: boolean,
89): void => {
90 client.setQueryData<BlockData>(
91 getBlockPanelQueryKey(user, postId),
92 (current) => ({
93 ...current,
94 showTagsPanel: isHidden || undefined,
95 mode: 'hide',
96 }),
97 );
98};
99
100export const useBlockPostPanel = (
101 post: Post | ReadHistoryPost,

Callers 1

useWhatsOffChangeFunction · 0.90

Calls 1

getBlockPanelQueryKeyFunction · 0.85

Tested by

no test coverage detected