Skip to content

Commit

Permalink
test without refresher
Browse files Browse the repository at this point in the history
  • Loading branch information
valpinkman committed Jan 17, 2025
1 parent 2e8b0cc commit a7c71bc
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ import { useEffect } from "react";
import { useDispatch } from "react-redux";
import { Subscription, Observable } from "rxjs";
import { useFeature } from "@ledgerhq/live-common/featureFlags/index";
import { useDeviceManagementKit, DeviceManagementKitTransport } from "@ledgerhq/live-dmk";
import {
useDeviceManagementKit,
DeviceManagementKitTransport,
useDeviceSessionRefresherToggle,
} from "@ledgerhq/live-dmk";
import { DeviceModelId } from "@ledgerhq/types-devices";
import { IPCTransport } from "~/renderer/IPCTransport";
import { addDevice, removeDevice, resetDevices } from "~/renderer/actions/devices";
Expand All @@ -13,6 +17,8 @@ export const useListenToHidDevices = () => {

const deviceManagementKit = useDeviceManagementKit();

useDeviceSessionRefresherToggle(ldmkFeatureFlag?.enabled ?? false);

useEffect(() => {
let sub: Subscription;

Expand Down
1 change: 1 addition & 0 deletions libs/ledger-live-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@
"@ledgerhq/live-config": "workspace:^",
"@ledgerhq/live-countervalues": "workspace:^",
"@ledgerhq/live-countervalues-react": "workspace:^",
"@ledgerhq/live-dmk": "workspace:^",
"@ledgerhq/live-env": "workspace:^",
"@ledgerhq/live-hooks": "workspace:*",
"@ledgerhq/live-network": "workspace:^",
Expand Down
9 changes: 6 additions & 3 deletions libs/live-dmk/src/hooks/useDeviceSessionRefresherToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ export const useDeviceSessionRefresherToggle = (enabled: boolean) => {
if (sessionId.current) {
sdk.toggleDeviceSessionRefresher({
sessionId: sessionId.current,
enabled: true,
// TODO: remove this once we have a proper way to disable the refresher
enabled: false,
});
}

Expand All @@ -36,7 +37,8 @@ export const useDeviceSessionRefresherToggle = (enabled: boolean) => {
if (sessionId.current) {
sdk.toggleDeviceSessionRefresher({
sessionId: sessionId.current,
enabled: true,
// TODO: remove this once we have a proper way to disable the refresher
enabled: false,
});
}
};
Expand All @@ -48,7 +50,8 @@ export const useDeviceSessionRefresherToggle = (enabled: boolean) => {
if (sessionId.current) {
sdk.toggleDeviceSessionRefresher({
sessionId: sessionId.current,
enabled: true,
// TODO: remove this once we have a proper way to disable the refresher
enabled: false,
});
}
}, [sdk]);
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a7c71bc

Please sign in to comment.