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

OUTDATED - Smartling translations are updated for PR#8807 from feat/dsdk-508-listen-known-devices #9057

Open
wants to merge 19 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
9552888
🔧 (build): Update our tsconfig to use `nodenext` or `bundler`
valpinkman Dec 4, 2024
aeefba6
✨ (lld): use dmk listenToKnownDevices in LLD
valpinkman Dec 2, 2024
89feb9a
✨(live-dmk): Update DMK to support synconboarding
valpinkman Dec 31, 2024
3dc1e61
♻️ (lmdk): Update repo for LDMK support
valpinkman Jan 10, 2025
819a7b3
tmp fix errors on ubuntu
valpinkman Jan 16, 2025
73d5695
:bug: (live-dmk): Fix hid reconnection on Ubuntu
paoun-ledger Jan 22, 2025
ab08c06
♻️ (lld): move ldmk indicator in the sidebar
valpinkman Jan 23, 2025
832a9d8
chore: fix aptos lib
valpinkman Jan 28, 2025
c2721c2
chore: bump dmk to stable version
valpinkman Jan 28, 2025
f6197cd
File apps/ledger-live-desktop/static/i18n/en/app.json was updated on …
smartling-github-connector[bot] Jan 30, 2025
aa3f4a0
File apps/ledger-live-desktop/static/i18n/en/app.json was updated on …
smartling-github-connector[bot] Jan 30, 2025
098019d
File apps/ledger-live-desktop/static/i18n/en/app.json was updated on …
smartling-github-connector[bot] Jan 30, 2025
6ed4928
File apps/ledger-live-desktop/static/i18n/en/app.json was updated on …
smartling-github-connector[bot] Jan 30, 2025
8e2dcf6
File apps/ledger-live-desktop/static/i18n/en/app.json was updated on …
smartling-github-connector[bot] Jan 30, 2025
2ced28d
File apps/ledger-live-desktop/static/i18n/en/app.json was updated on …
smartling-github-connector[bot] Jan 30, 2025
ef01cf4
File apps/ledger-live-desktop/static/i18n/en/app.json was updated on …
smartling-github-connector[bot] Jan 30, 2025
69dedeb
File apps/ledger-live-desktop/static/i18n/en/app.json was updated on …
smartling-github-connector[bot] Jan 30, 2025
f2bb909
File apps/ledger-live-desktop/static/i18n/en/app.json was updated on …
smartling-github-connector[bot] Jan 30, 2025
d22303c
File apps/ledger-live-desktop/static/i18n/en/app.json was updated on …
smartling-github-connector[bot] Jan 30, 2025
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
5 changes: 5 additions & 0 deletions .changeset/heavy-lobsters-rush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@ledgerhq/live-dmk": minor
---

Update Transport.listen to emit add and remove events
5 changes: 5 additions & 0 deletions .changeset/tall-toys-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ledger-live-desktop": minor
---

use dmk listenToKnownDevices in LLD:useListenToHidDevices
5 changes: 2 additions & 3 deletions apps/cli/src/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"module": "commonjs",
"module": "nodenext",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
Expand All @@ -10,8 +10,7 @@
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"skipLibCheck": true,

"moduleResolution": "node",
"moduleResolution": "nodenext",
"downlevelIteration": true,
"resolveJsonModule": true,
"rootDir": ".",
Expand Down
3 changes: 2 additions & 1 deletion apps/ledger-live-desktop/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"@ledgerhq/coin-filecoin": "workspace:^",
"@ledgerhq/coin-framework": "workspace:^",
"@ledgerhq/devices": "workspace:*",
"@ledgerhq/device-management-kit": "0.5.1",
"@ledgerhq/domain-service": "workspace:^",
"@ledgerhq/errors": "workspace:^",
"@ledgerhq/ethereum-provider": "workspace:^",
Expand All @@ -74,7 +75,7 @@
"@ledgerhq/live-config": "workspace:^",
"@ledgerhq/live-countervalues": "workspace:^",
"@ledgerhq/live-countervalues-react": "workspace:^",
"@ledgerhq/live-dmk": "workspace:*",
"@ledgerhq/live-dmk": "workspace:^",
"@ledgerhq/live-env": "workspace:^",
"@ledgerhq/live-network": "workspace:^",
"@ledgerhq/live-nft": "workspace:^",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from "react";
import { Button as BaseButton, InvertTheme } from "@ledgerhq/react-ui";
import { ButtonProps as BaseButtonProps } from "@ledgerhq/react-ui/components/cta/Button";
import { ButtonProps as BaseButtonProps } from "@ledgerhq/react-ui/components/cta/Button/index";
import { useTrack } from "~/renderer/analytics/segment";
import styled from "styled-components";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export const RenderLoadingImage = ({
alignItems="center"
data-testid={`device-action-image-loading-${progress}`}
>
<DeviceBlocker />
<AnimationWrapper>
<FramedPicture
frameConfig={getFramedPictureConfig("transfer", deviceModelId, type)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ import {
Text,
Theme,
} from "@ledgerhq/react-ui";
import { LockAltMedium } from "@ledgerhq/react-ui/assets/icons";
import { withV3StyleProvider } from "~/renderer/styles/StyleProviderV3";
import DeviceIllustration from "~/renderer/components/DeviceIllustration";
import { Account } from "@ledgerhq/types-live";
Expand Down Expand Up @@ -642,7 +641,7 @@ export const renderLockedDeviceError = ({
return (
<Wrapper id="error-locked-device">
<ErrorBody
Icon={LockAltMedium}
Icon={IconsLegacy.LockAltMedium}
title={t("errors.LockedDeviceError.title")}
description={
productName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,10 @@ const T = styled(Box).attrs((p: { color?: string; inline?: boolean; ff?: string
width: ${p => (p.inline ? "" : "100%")};
overflow: hidden;
`;
const I = ({ color, children }: { color?: string; children: React.ReactNode }) => (
const I = ({ color = undefined, children }: { color?: string; children: React.ReactNode }) => (
<Box color={color}>{children}</Box>
);
I.defaultProps = {
color: undefined,
};

export type OwnProps = {
unit?: Unit;
val?: BigNumber | number;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import styled, { DefaultTheme, StyledComponent } from "styled-components";
import { Box } from "@ledgerhq/react-ui";
import { BoxProps } from "@ledgerhq/react-ui/components/layout/Box";
import { BoxProps } from "@ledgerhq/react-ui/components/layout/Box/index";

type Props = {
lightSource: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,20 +182,6 @@ const SideBarScrollContainer = styled(Box)`
}
`;

const LDMKTransportFlag = styled.div`
z-index: 51;
position: absolute;
top: 0;
right: 0;
transform: translate(100%, 0);
padding: 5px;
background: ${p => p.theme.colors.palette.opacityPurple.c90};
color: ${p => p.theme.colors.palette.text.shade100};
font-weight: bold;
border-radius: 0 0 4px 0;
opacity: 0.8;
`;

const TagContainerExperimental = ({ collapsed }: { collapsed: boolean }) => {
const isExperimental = useExperimental();
const hasFullNodeConfigured = useEnv("SATSTACK"); // NB remove once full node is not experimental
Expand Down Expand Up @@ -235,6 +221,23 @@ const TagContainerFeatureFlags = ({ collapsed }: { collapsed: boolean }) => {
) : null;
};

const TagContainerLDMK = ({ collapsed }: { collapsed: boolean }) => {
const ldmkTransportFlag = useFeature("ldmkTransport");
const { t } = useTranslation();
return ldmkTransportFlag?.enabled && ldmkTransportFlag?.params?.warningVisible ? (
<Tag
data-testid="drawer-ldmk-button"
to={{
pathname: "/settings/developer",
}}
onClick={() => setTrackingSource("sidebar")}
>
<Icons.UsbC size="S" color="primary.c80" />
<TagText collapsed={collapsed}>{t("common.ldmkEnabled")}</TagText>
</Tag>
) : null;
};

// Check if the selected tab is a Live-App under discovery tab
const checkLiveAppTabSelection = (location: Location, liveAppPaths: Array<string>) =>
liveAppPaths.find((liveTab: string) => location?.pathname?.includes(liveTab));
Expand All @@ -259,7 +262,6 @@ const MainSideBar = () => {
const referralProgramConfig = useFeature("referralProgramDesktopSidebar");
const recoverFeature = useFeature("protectServicesDesktop");
const recoverHomePath = useAccountPath(recoverFeature);
const ldmkTransportFlag = useFeature("ldmkTransport");

const handleCollapse = useCallback(() => {
dispatch(setSidebarCollapsed(!collapsed));
Expand Down Expand Up @@ -394,9 +396,6 @@ const MainSideBar = () => {
</Collapser>

<SideBarScrollContainer>
{ldmkTransportFlag?.enabled && ldmkTransportFlag?.params?.warningVisible && (
<LDMKTransportFlag>{t("ldmkFeatureFlagWarning.title")}</LDMKTransportFlag>
)}
<TopGradient />
<Space of={60} />
<SideBarList collapsed={secondAnim}>
Expand Down Expand Up @@ -571,6 +570,7 @@ const MainSideBar = () => {
<Box pt={4}>
<TagContainerExperimental collapsed={!secondAnim} />
<TagContainerFeatureFlags collapsed={!secondAnim} />
<TagContainerLDMK collapsed={!secondAnim} />
</Box>
</SideBar>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { useTranslation } from "react-i18next";
import styled, { DefaultTheme, StyledComponent } from "styled-components";
import { Box, Text, Flex, Icon, Switch } from "@ledgerhq/react-ui";
import { BoxProps } from "@ledgerhq/react-ui/components/layout/Box/index";
import { SwitchProps } from "@ledgerhq/react-ui/components/form/Switch/Switch";
import { TextProps } from "@ledgerhq/react-ui/components/asorted/Text";
import { SwitchProps } from "@ledgerhq/react-ui/components/form/Switch/index";
import { TextProps } from "@ledgerhq/react-ui/components/asorted/Text/index";

export const WaveContainer: StyledComponent<"div", DefaultTheme, BoxProps> = styled(Box).attrs({
position: "absolute",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { isStuckOperation } from "@ledgerhq/live-common/operation";
import { InfiniteLoader } from "@ledgerhq/react-ui";
import { WarningSolidMedium } from "@ledgerhq/react-ui/assets/icons";
import { InfiniteLoader, IconsLegacy } from "@ledgerhq/react-ui";
import { Operation } from "@ledgerhq/types-live";
import { TFunction } from "i18next";
import React from "react";
Expand Down Expand Up @@ -31,7 +30,7 @@ const PendingLoadingIcon = ({ displayWarning }: { displayWarning: boolean }): JS
if (displayWarning) {
return (
<Box style={{ verticalAlign: "sub", display: "inline" }}>
<WarningSolidMedium size={12} color={"#FFBD42"} />
<IconsLegacy.WarningSolidMedium size={12} color={"#FFBD42"} />
</Box>
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useEffect, useState } from "react";
import { Account, AccountLike, TransactionCommon } from "@ledgerhq/types-live";
import { useDebounce } from "@ledgerhq/live-common//hooks/useDebounce";
import { useDebounce } from "@ledgerhq/live-common/hooks/useDebounce";
import { getAccountBridge } from "@ledgerhq/live-common/bridge/index";
import FormattedVal from "~/renderer/components/FormattedVal";
import BigNumber from "bignumber.js";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from "react";
import { Flex, Text, InfiniteLoader, IconsLegacy } from "@ledgerhq/react-ui";
import styled, { StyledComponent, DefaultTheme } from "styled-components";
import { FlexBoxProps } from "@ledgerhq/react-ui/components/layout/Flex";
import { FlexBoxProps } from "@ledgerhq/react-ui/components/layout/Flex/index";
import { Status } from "../types";

const BorderFlex: StyledComponent<"div", DefaultTheme, FlexBoxProps> = styled(Flex).attrs({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import SeedStep, { SeedPathStatus } from "./SeedStep";
import { analyticsFlowName, StepText } from "./shared";
import OnboardingAppInstallStep from "../../OnboardingAppInstall";
import { getOnboardingStatePolling } from "@ledgerhq/live-common/hw/getOnboardingStatePolling";
import { isAllowedOnboardingStatePollingErrorDmk } from "@ledgerhq/live-dmk";
import ContinueOnDeviceWithAnim from "./ContinueOnDeviceWithAnim";
import { RecoverState } from "~/renderer/screens/recover/Player";
import TrackPage from "~/renderer/analytics/TrackPage";
Expand Down Expand Up @@ -245,6 +246,7 @@ const SyncOnboardingCompanion: React.FC<SyncOnboardingCompanionProps> = ({
device: device || null,
pollingPeriodMs: POLLING_PERIOD_MS,
stopPolling: !isPollingOn,
allowedErrorChecks: [isAllowedOnboardingStatePollingErrorDmk],
});

const handleDeviceReady = useCallback(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ import SyncOnboardingDeviceConnection, {
import SyncOnboardingManual, { SyncOnboardingScreenProps } from "./Manual";
import CompletionScreen from "./Manual/CompletionScreen";
import { useKeepScreenAwake } from "~/renderer/hooks/useKeepScreenAwake";
import { useDeviceSessionRefresherToggle } from "@ledgerhq/live-dmk";
import { useFeature } from "@ledgerhq/live-common/featureFlags/index";

export type DeviceConnectionRouteProps = RouteComponentProps<SyncOnboardingDeviceConnectionProps>;
export type ManualRouteProps = RouteComponentProps<SyncOnboardingScreenProps>;

const SyncOnboarding = () => {
const ldmkTransportFlag = useFeature("ldmkTransport");
const { path } = useRouteMatch();
useKeepScreenAwake(true);
useDeviceSessionRefresherToggle(ldmkTransportFlag?.enabled ?? false);

return (
<Flex width="100%" height="100%" position="relative">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import { NotificationIndicator } from "~/renderer/components/TopBar/Notification
import { setTrackingSource } from "~/renderer/analytics/TrackPage";
import { LiveAppDrawer } from "~/renderer/components/LiveAppDrawer";
import { IconsLegacy } from "@ledgerhq/react-ui";

const Container = styled(Box).attrs(() => ({}))`
height: ${p => p.theme.sizes.topBarHeight}px;
box-sizing: content-box;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import React, { useEffect, useMemo } from "react";
import { Trans, useTranslation } from "react-i18next";
import { useFeature } from "@ledgerhq/live-common/featureFlags/index";
import logger from "~/renderer/logger";
import Text from "../Text";
import ExternalLink from "../ExternalLink";
Expand Down Expand Up @@ -35,6 +36,7 @@ function ErrorList({ translation }: ErrorListProps) {

export function TranslatedError({ error, fallback, field = "title", noLink }: Props): JSX.Element {
const { t } = useTranslation();
const ldmkTransportFlag = useFeature("ldmkTransport");

const errorName = error?.name;

Expand Down Expand Up @@ -65,7 +67,22 @@ export function TranslatedError({ error, fallback, field = "title", noLink }: Pr
}
}, [isValidError, error]);

if (!error || !isValidError) return <></>;
if (!error || !isValidError) {
// NOTE: Temporary handling of DMK errors
if (ldmkTransportFlag?.enabled && error && "_tag" in error) {
if (field === "description") {
const errorMessage =
"originalError" in error
? (error.originalError as Error).message
: (error._tag as string);

return <Text>{errorMessage}</Text>;
}
return <Text>{error._tag as string}</Text>;
}

return <></>;
}

if (!translation) {
if (fallback) return <>{fallback}</>;
Expand Down
Loading
Loading