| 1 | /** |
| 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
| 3 | * |
| 4 | * This source code is licensed under the MIT license found in the |
| 5 | * LICENSE file in the root directory of this source tree. |
| 6 | */ |
| 7 | |
| 8 | import {atom} from 'jotai'; |
| 9 | import {codeReviewProvider} from '../CodeReviewInfo'; |
| 10 | |
| 11 | /** Experimental backdoor setting to get around disabled submit modes. Useful for testing. */ |
| 12 | export const overrideDisabledSubmitModes = atom(process.env.NODE_ENV === 'development'); |
| 13 | |
| 14 | export const experimentalBranchPRsEnabled = atom(process.env.NODE_ENV === 'development'); |
| 15 | |
| 16 | export const branchPRsSupported = atom(get => { |
| 17 | const supported = get(codeReviewProvider)?.supportBranchingPrs ?? false; |
| 18 | const enabled = get(experimentalBranchPRsEnabled); |
| 19 | return supported && enabled; |
| 20 | }); |
| 21 | |