Download wp-calypso/client/landing/stepper/utils/skip-launchpad.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 542 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/landing/stepper/utils/skip-launchpad.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/landing/stepper/utils/skip-launchpad.ts
-
curl -L -o skip-launchpad.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/landing/stepper/utils/skip-launchpad.ts
542 Bytes
| import { updateLaunchpadSettings } from '@automattic/data-stores'; | |
| type SkipLaunchpadProps = { | |
| siteId: string | number | null; | |
| siteSlug: string | null; | |
| redirectToHome?: boolean; | |
| }; | |
| export const skipLaunchpad = async ( { | |
| siteId, | |
| siteSlug, | |
| redirectToHome = true, | |
| }: SkipLaunchpadProps ) => { | |
| const siteIdOrSlug = siteId || siteSlug; | |
| if ( siteIdOrSlug ) { | |
| await updateLaunchpadSettings( siteIdOrSlug, { launchpad_screen: 'skipped' } ); | |
| } | |
| if ( redirectToHome ) { | |
| return window.location.assign( `/home/${ siteIdOrSlug }` ); | |
| } | |
| }; | |