Skip to content

Commit be91230

Browse files
authored
Merge pull request #46932 from cretadn22/using-useOnyx
Using useOnyx to get session
2 parents 6c4502a + 047f8c7 commit be91230

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/Expensify.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import PopoverReportActionContextMenu from './pages/home/report/ContextMenu/Popo
4141
import * as ReportActionContextMenu from './pages/home/report/ContextMenu/ReportActionContextMenu';
4242
import type {Route} from './ROUTES';
4343
import ROUTES from './ROUTES';
44-
import type {ScreenShareRequest, Session} from './types/onyx';
44+
import type {ScreenShareRequest} from './types/onyx';
4545

4646
Onyx.registerLogger(({level, message}) => {
4747
if (level === 'alert') {
@@ -58,9 +58,6 @@ type ExpensifyOnyxProps = {
5858
/** Whether the app is waiting for the server's response to determine if a room is public */
5959
isCheckingPublicRoom: OnyxEntry<boolean>;
6060

61-
/** Session info for the currently logged in user. */
62-
session: OnyxEntry<Session>;
63-
6461
/** Whether a new update is available and ready to install. */
6562
updateAvailable: OnyxEntry<boolean>;
6663

@@ -91,7 +88,6 @@ const SplashScreenHiddenContext = React.createContext<SplashScreenHiddenContextT
9188

9289
function Expensify({
9390
isCheckingPublicRoom = true,
94-
session,
9591
updateAvailable,
9692
isSidebarLoaded = false,
9793
screenShareRequest,
@@ -106,6 +102,7 @@ function Expensify({
106102
const [hasAttemptedToOpenPublicRoom, setAttemptedToOpenPublicRoom] = useState(false);
107103
const {translate} = useLocalize();
108104
const [account] = useOnyx(ONYXKEYS.ACCOUNT);
105+
const [session] = useOnyx(ONYXKEYS.SESSION);
109106
const [shouldShowRequire2FAModal, setShouldShowRequire2FAModal] = useState(false);
110107

111108
useEffect(() => {
@@ -317,9 +314,6 @@ export default withOnyx<ExpensifyProps, ExpensifyOnyxProps>({
317314
key: ONYXKEYS.IS_CHECKING_PUBLIC_ROOM,
318315
initWithStoredValues: false,
319316
},
320-
session: {
321-
key: ONYXKEYS.SESSION,
322-
},
323317
updateAvailable: {
324318
key: ONYXKEYS.UPDATE_AVAILABLE,
325319
initWithStoredValues: false,

0 commit comments

Comments
 (0)