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

Function togglePreview

packages/shared/src/hooks/profile/useProfilePreview.ts:31–46  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29 );
30
31 const togglePreview = () => {
32 const newQuery = { ...router.query };
33 if (isPreviewMode) {
34 delete newQuery.preview;
35 } else {
36 newQuery.preview = 'true';
37 }
38 router.replace(
39 {
40 pathname: router.pathname,
41 query: newQuery,
42 },
43 undefined,
44 { shallow: true },
45 );
46 };
47
48 return {
49 isPreviewMode,

Callers

nothing calls this directly

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected