Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using useOnyx to get session #46932

Merged
merged 3 commits into from
Aug 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions src/Expensify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ import PopoverReportActionContextMenu from './pages/home/report/ContextMenu/Popo
import * as ReportActionContextMenu from './pages/home/report/ContextMenu/ReportActionContextMenu';
import type {Route} from './ROUTES';
import ROUTES from './ROUTES';
import type {ScreenShareRequest, Session} from './types/onyx';
import type {ScreenShareRequest} from './types/onyx';

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

/** Session info for the currently logged in user. */
session: OnyxEntry<Session>;

/** Whether a new update is available and ready to install. */
updateAvailable: OnyxEntry<boolean>;

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

function Expensify({
isCheckingPublicRoom = true,
session,
updateAvailable,
isSidebarLoaded = false,
screenShareRequest,
Expand All @@ -106,6 +102,7 @@ function Expensify({
const [hasAttemptedToOpenPublicRoom, setAttemptedToOpenPublicRoom] = useState(false);
const {translate} = useLocalize();
const [account] = useOnyx(ONYXKEYS.ACCOUNT);
const [session] = useOnyx(ONYXKEYS.SESSION);
const [shouldShowRequire2FAModal, setShouldShowRequire2FAModal] = useState(false);

useEffect(() => {
Expand Down Expand Up @@ -317,9 +314,6 @@ export default withOnyx<ExpensifyProps, ExpensifyOnyxProps>({
key: ONYXKEYS.IS_CHECKING_PUBLIC_ROOM,
initWithStoredValues: false,
},
session: {
key: ONYXKEYS.SESSION,
},
updateAvailable: {
key: ONYXKEYS.UPDATE_AVAILABLE,
initWithStoredValues: false,
Expand Down
Loading