-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57328 from software-mansion-labs/refactor-switch-…
…to-old-dot-on-11+ Define noop implementation of 11+ redirect for desktop app
- Loading branch information
Showing
5 changed files
with
42 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/libs/actions/Welcome/switchToOldDotOnNonMicroCompanySize/index.desktop.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import type SwitchToOldDotOnNonMicroCompanySize from './types'; | ||
|
||
// We don't want to use this API on desktop, so we just noop here | ||
const switchToOldDotOnNonMicroCompanySize: SwitchToOldDotOnNonMicroCompanySize = () => {}; | ||
|
||
export default switchToOldDotOnNonMicroCompanySize; |
29 changes: 29 additions & 0 deletions
29
src/libs/actions/Welcome/switchToOldDotOnNonMicroCompanySize/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import type {OnyxUpdate} from 'react-native-onyx'; | ||
import Onyx from 'react-native-onyx'; | ||
import * as API from '@libs/API'; | ||
import {WRITE_COMMANDS} from '@libs/API/types'; | ||
import CONST from '@src/CONST'; | ||
import ONYXKEYS from '@src/ONYXKEYS'; | ||
import type SwitchToOldDotOnNonMicroCompanySize from './types'; | ||
|
||
const switchToOldDotOnNonMicroCompanySize: SwitchToOldDotOnNonMicroCompanySize = (onboardingCompanySize) => { | ||
if (onboardingCompanySize === CONST.ONBOARDING_COMPANY_SIZE.MICRO) { | ||
return; | ||
} | ||
|
||
const optimisticData: OnyxUpdate[] = [ | ||
{ | ||
onyxMethod: Onyx.METHOD.MERGE, | ||
key: ONYXKEYS.NVP_TRYNEWDOT, | ||
value: { | ||
classicRedirect: { | ||
dismissed: true, | ||
}, | ||
}, | ||
}, | ||
]; | ||
|
||
API.write(WRITE_COMMANDS.SWITCH_TO_OLD_DOT_ON_COMPANY_SIZE, {onboardingCompanySize}, {optimisticData}); | ||
}; | ||
|
||
export default switchToOldDotOnNonMicroCompanySize; |
5 changes: 5 additions & 0 deletions
5
src/libs/actions/Welcome/switchToOldDotOnNonMicroCompanySize/types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import type {OnboardingCompanySize} from '@src/CONST'; | ||
|
||
type SwitchToOldDotOnNonMicroCompanySize = (onboardingCompanySize: OnboardingCompanySize) => void; | ||
|
||
export default SwitchToOldDotOnNonMicroCompanySize; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters