Skip to content

Commit

Permalink
fix: prevent from undefined key
Browse files Browse the repository at this point in the history
  • Loading branch information
RamyEB committed May 3, 2024
1 parent 7b8171e commit 45fc8b9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ export function PlatformAppProviderWrapper({ children }: PlatformAppProviderWrap
}

function useLocalLiveAppDB() {
return useDB("app", DISCOVER_STORE_KEY, INITIAL_PLATFORM_STATE, state => {
return state.localLiveApp;
});
return useDB(
"app",
DISCOVER_STORE_KEY,
INITIAL_PLATFORM_STATE,
state => state.localLiveApp || INITIAL_PLATFORM_STATE.localLiveApp,
);
}
2 changes: 1 addition & 1 deletion apps/ledger-live-mobile/src/PlatformAppProviderWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ function useLocalLiveAppDB() {
return useDB<DiscoverDB, DiscoverDB["localLiveApp"]>(
DISCOVER_STORE_KEY,
INITIAL_PLATFORM_STATE,
state => state.localLiveApp,
state => state.localLiveApp || INITIAL_PLATFORM_STATE.localLiveApp,
);
}

0 comments on commit 45fc8b9

Please sign in to comment.