@@ -7,18 +7,9 @@ import Onyx from 'react-native-onyx';
7
7
import type { ValueOf } from 'type-fest' ;
8
8
import { importEmojiLocale } from '@assets/emojis' ;
9
9
import * as API from '@libs/API' ;
10
- import type {
11
- GetMissingOnyxMessagesParams ,
12
- HandleRestrictedEventParams ,
13
- OpenAppParams ,
14
- OpenOldDotLinkParams ,
15
- OpenProfileParams ,
16
- ReconnectAppParams ,
17
- UpdatePreferredLocaleParams ,
18
- } from '@libs/API/parameters' ;
10
+ import type { GetMissingOnyxMessagesParams , HandleRestrictedEventParams , OpenAppParams , OpenOldDotLinkParams , ReconnectAppParams , UpdatePreferredLocaleParams } from '@libs/API/parameters' ;
19
11
import { SIDE_EFFECT_REQUEST_COMMANDS , WRITE_COMMANDS } from '@libs/API/types' ;
20
12
import * as Browser from '@libs/Browser' ;
21
- import DateUtils from '@libs/DateUtils' ;
22
13
import { buildEmojisTrie } from '@libs/EmojiTrie' ;
23
14
import Log from '@libs/Log' ;
24
15
import getCurrentUrl from '@libs/Navigation/currentUrl' ;
@@ -32,7 +23,6 @@ import type {OnyxKey} from '@src/ONYXKEYS';
32
23
import type { Route } from '@src/ROUTES' ;
33
24
import ROUTES from '@src/ROUTES' ;
34
25
import type * as OnyxTypes from '@src/types/onyx' ;
35
- import type { SelectedTimezone } from '@src/types/onyx/PersonalDetails' ;
36
26
import type { OnyxData } from '@src/types/onyx/Request' ;
37
27
import * as Policy from './Policy/Policy' ;
38
28
import * as Session from './Session' ;
@@ -457,52 +447,6 @@ function redirectThirdPartyDesktopSignIn() {
457
447
}
458
448
}
459
449
460
- function openProfile ( personalDetails : OnyxTypes . PersonalDetails ) {
461
- const oldTimezoneData = personalDetails . timezone ?? { } ;
462
- let newTimezoneData = oldTimezoneData ;
463
-
464
- if ( oldTimezoneData ?. automatic ?? true ) {
465
- newTimezoneData = {
466
- automatic : true ,
467
- selected : Intl . DateTimeFormat ( ) . resolvedOptions ( ) . timeZone as SelectedTimezone ,
468
- } ;
469
- }
470
-
471
- newTimezoneData = DateUtils . formatToSupportedTimezone ( newTimezoneData ) ;
472
-
473
- const parameters : OpenProfileParams = {
474
- timezone : JSON . stringify ( newTimezoneData ) ,
475
- } ;
476
-
477
- // We expect currentUserAccountID to be a number because it doesn't make sense to open profile if currentUserAccountID is not set
478
- if ( typeof currentUserAccountID === 'number' ) {
479
- API . write ( WRITE_COMMANDS . OPEN_PROFILE , parameters , {
480
- optimisticData : [
481
- {
482
- onyxMethod : Onyx . METHOD . MERGE ,
483
- key : ONYXKEYS . PERSONAL_DETAILS_LIST ,
484
- value : {
485
- [ currentUserAccountID ] : {
486
- timezone : newTimezoneData ,
487
- } ,
488
- } ,
489
- } ,
490
- ] ,
491
- failureData : [
492
- {
493
- onyxMethod : Onyx . METHOD . MERGE ,
494
- key : ONYXKEYS . PERSONAL_DETAILS_LIST ,
495
- value : {
496
- [ currentUserAccountID ] : {
497
- timezone : oldTimezoneData ,
498
- } ,
499
- } ,
500
- } ,
501
- ] ,
502
- } ) ;
503
- }
504
- }
505
-
506
450
/**
507
451
* @param shouldAuthenticateWithCurrentAccount Optional, indicates whether default authentication method (shortLivedAuthToken) should be used
508
452
*/
@@ -558,7 +502,6 @@ export {
558
502
setLocaleAndNavigate ,
559
503
setSidebarLoaded ,
560
504
setUpPoliciesAndNavigate ,
561
- openProfile ,
562
505
redirectThirdPartyDesktopSignIn ,
563
506
openApp ,
564
507
reconnectApp ,
0 commit comments