Skip to content

Commit

Permalink
refactor: add fallback consts in case flags do not load
Browse files Browse the repository at this point in the history
  • Loading branch information
beths-ledger committed Apr 19, 2024
1 parent 11592fe commit d3b4a86
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export const WebPTXPlayer = ({ manifest, inputs, disableHeader }: Props) => {
const lastMatchingURL = useRef<string | null>(null);
const webviewAPIRef = useRef<WebviewAPI>(null);
const [webviewState, setWebviewState] = useState<WebviewState>(initialWebviewState);
const internalAppIds = useInternalAppIds();
const internalAppIds = useInternalAppIds() || INTERNAL_APP_IDS;

const isInternalApp = useMemo(() => {
if (!internalAppIds.includes(manifest.id)) {
Expand Down
3 changes: 2 additions & 1 deletion apps/ledger-live-mobile/src/screens/PTX/BuyAndSell/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { ScreenName } from "~/const";
import { accountsSelector } from "~/reducers/accounts";
import { WALLET_API_VERSION } from "@ledgerhq/live-common/wallet-api/constants";
import { useInternalAppIds } from "@ledgerhq/live-common/hooks/useInternalAppIds";
import { INTERNAL_APP_IDS } from "@ledgerhq/live-common/wallet-api/constants";

export type Props = StackNavigatorProps<
ExchangeNavigatorParamList,
Expand All @@ -41,7 +42,7 @@ export function BuyAndSellScreen({ route }: Props) {
const { state: remoteLiveAppState } = useRemoteLiveAppContext();
const { locale } = useLocale();
const manifest = localManifest || remoteManifest;
const internalAppIds = useInternalAppIds();
const internalAppIds = useInternalAppIds() || INTERNAL_APP_IDS;

/**
* Pass correct account ID
Expand Down

0 comments on commit d3b4a86

Please sign in to comment.