-
Notifications
You must be signed in to change notification settings - Fork 338
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
feat: Use listenToKnownDevices from DMK #8566
base: develop
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
3 Skipped Deployments
|
8c5771b
to
ad1c9a7
Compare
ad1c9a7
to
facdfe4
Compare
facdfe4
to
b09b75e
Compare
const store = useStore<State>(); | ||
const localOverrides = overriddenFeatureFlagsSelector(store.getState()); | ||
const ldmkFeatureFlag = getFeature({ key: "ldmkTransport", localOverrides }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[SHOULD] Here you can just do const ldmkFeatureFlag = useFeature("ldmkTransport")
since you're in a react context, with the FF provider & the store at the root of the app, the overrides will already be computed.
This logic was needed in live-common-setup.ts
because it's not in a react context.
useEffect(() => { | ||
let sub: Subscription; | ||
function syncDevices() { | ||
const devices: { [key: string]: boolean } = {}; | ||
const devices: { [key: string]: boolean } = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[COULD] As we saw this variable is unused, it can be removed.
registerTransportModule({ | ||
id: "sdk", | ||
open: (_id: string, timeoutMs?: number, context?: TraceContext) => { | ||
if (!ldmkFeatureFlag().enabled) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[SHOULD] also ensure that we return undefined in case we're using a vault device, or a speculos emulator, a proxy etc. as they are not yet supported in the DMK.
b09b75e
to
0322fd5
Compare
✅ Checklist
npx changeset
was attached.📝 Description
Update
useListenToHidDevices
to be able to rely on the DMKlistenToKnownDevices()
when the feature flag is on.Also update the way we register the transports so everything is available at any time (but the
open
on the LiveDMKTransport only works when FF is on)Changed the default verbosity on the DMK Logger.
❓ Context
🧐 Checklist for the PR Reviewers