Skip to content

Commit

Permalink
feat: update manifest id for multibuy to v2 (#4648)
Browse files Browse the repository at this point in the history
  • Loading branch information
cksanders authored Sep 11, 2023
1 parent 34e7f6f commit 8b09b0b
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
7 changes: 7 additions & 0 deletions .changeset/quick-students-glow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"ledger-live-desktop": patch
"live-mobile": patch
"@ledgerhq/live-common": patch
---

Update multibuy manifest to v2 to ensure full backwards compatibility
2 changes: 1 addition & 1 deletion apps/ledger-live-desktop/tests/specs/services/buy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ test.beforeAll(async () => {
// Check that dummy app in libs/test-utils/dummy-ptx-app has been started successfully
testServerIsRunning = await LiveAppWebview.startLiveApp("dummy-ptx-app/public", {
name: "Buy App",
id: "multibuy",
id: "multibuy-v2",
permissions: [
{
method: "account.request",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useMemo } from "react";
import { createStackNavigator } from "@react-navigation/stack";
import { useTheme } from "styled-components/native";
import { findCryptoCurrencyByKeyword } from "@ledgerhq/live-common/currencies/index";
import { DEFAULT_MULTIBUY_APP_ID } from "@ledgerhq/live-common/wallet-api/constants";
import { ScreenName } from "../../const";
import { getStackNavigatorConfig } from "../../navigation/navigatorConfig";

Expand All @@ -28,7 +29,7 @@ const ExchangeBuy = (
goToURL: _props.route.params?.goToURL,
lastScreen: _props.route.params?.lastScreen,
mode: "buy",
platform: _props.route.params?.platform || "multibuy",
platform: _props.route.params?.platform || DEFAULT_MULTIBUY_APP_ID,
referrer: _props.route.params?.referrer,
},
}}
Expand All @@ -52,7 +53,7 @@ const ExchangeSell = (
goToURL: _props.route.params?.goToURL,
lastScreen: _props.route.params?.lastScreen,
mode: "sell",
platform: _props.route.params?.platform || "multibuy",
platform: _props.route.params?.platform || DEFAULT_MULTIBUY_APP_ID,
referrer: _props.route.params?.referrer,
},
}}
Expand Down
4 changes: 3 additions & 1 deletion apps/ledger-live-mobile/src/navigation/DeeplinksProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import SplashScreen from "react-native-splash-screen";
import { getStateFromPath, LinkingOptions, NavigationContainer } from "@react-navigation/native";
import { useFlipper } from "@react-navigation/devtools";
import { useRemoteLiveAppContext } from "@ledgerhq/live-common/platform/providers/RemoteLiveAppProvider/index";
import { DEFAULT_MULTIBUY_APP_ID } from "@ledgerhq/live-common/wallet-api/constants";

import Braze from "react-native-appboy-sdk";
import { LiveAppManifest } from "@ledgerhq/live-common/platform/types";
import useFeature from "@ledgerhq/live-common/featureFlags/useFeature";
Expand Down Expand Up @@ -76,7 +78,7 @@ function getProxyURL(url: string) {
// This is to handle links set in the useFromAmountStatusMessage in LLC.
// Also handles a difference in paths between LLD on LLD /platform/:app_id
// but on LLM /discover/:app_id
if (hostname === "platform" && ["multibuy"].includes(platform)) {
if (hostname === "platform" && [DEFAULT_MULTIBUY_APP_ID].includes(platform)) {
return url.replace("://platform", "://discover");
}

Expand Down
2 changes: 1 addition & 1 deletion libs/ledger-live-common/src/wallet-api/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ export const DISCOVER_STORE_KEY = "discover";

export const DISCOVER_INITIAL_CATEGORY = "all";

export const DEFAULT_MULTIBUY_APP_ID = "multibuy";
export const DEFAULT_MULTIBUY_APP_ID = "multibuy-v2";

export const INTERNAL_APP_IDS = [DEFAULT_MULTIBUY_APP_ID];

1 comment on commit 8b09b0b

@vercel
Copy link

@vercel vercel bot commented on 8b09b0b Sep 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.