Skip to content

Commit

Permalink
refactor: Tweak when to start checking app startup time (#2136)
Browse files Browse the repository at this point in the history
  • Loading branch information
NigelBreslaw authored Jul 24, 2024
1 parent a681068 commit 3c481c9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 0 additions & 3 deletions native/app/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ if (Platform.OS !== "web") {
Appearance.setColorScheme("dark");
}

const startupTime = performance.now();
useGGStore.getState().setAppStartupTime(startupTime);

enableFreeze(true);

let customDownloadAttempts = 0;
Expand Down
4 changes: 4 additions & 0 deletions native/app/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
import "react-native-gesture-handler"; // Avoid crash in production https://reactnavigation.org/docs/stack-navigator/#installation
import * as Sentry from "@sentry/react-native";
import { registerRootComponent } from "expo";
import { useGGStore } from "@/app/store/GGStore.ts";

import Root from "./Root.tsx";

const startupTime = performance.now();
useGGStore.getState().setAppStartupTime(startupTime);

const routingInstrumentation = new Sentry.ReactNavigationInstrumentation({
enableTimeToInitialDisplay: true,
});
Expand Down
4 changes: 3 additions & 1 deletion native/app/store/Account/AccountSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ export const createAccountSlice: StateCreator<IStore, [], [], AccountSlice> = (s
rawProfileData: null,

setStateHydrated: () => set({ stateHydrated: true }),
setAppStartupTime: (appStartupTime) => set({ appStartupTime }),
setAppStartupTime: (appStartupTime) => {
set({ appStartupTime });
},
setRefreshing: (refreshing) => set({ refreshing }),
setPullRefreshing: (pullRefreshing) => set({ pullRefreshing }),
getPageData: (inventoryPage) => {
Expand Down

0 comments on commit 3c481c9

Please sign in to comment.