Download wp-calypso/client/blocks/login/utils/should-use-magic-code.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 529 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/blocks/login/utils/should-use-magic-code.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/wp-calypso/client/blocks/login/utils/should-use-magic-code.ts
-
curl -L -o should-use-magic-code.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/wp-calypso/client/blocks/login/utils/should-use-magic-code.ts
529 Bytes
| import config from '@automattic/calypso-config'; | |
| type ShouldUseMagicCodeProps = { | |
| /** | |
| * Whether the login is for a Jetpack site. | |
| */ | |
| isJetpack?: boolean; | |
| }; | |
| /** | |
| * Returns true if the login should use magic code. | |
| * @param {ShouldUseMagicCodeProps} options | |
| * @returns {boolean} | |
| */ | |
| export function shouldUseMagicCode( { isJetpack }: ShouldUseMagicCodeProps ): boolean { | |
| const isMagicCodeEnabled = config.isEnabled( 'login/use-magic-code' ); | |
| if ( isJetpack && isMagicCodeEnabled ) { | |
| return true; | |
| } | |
| return false; | |
| } | |