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

fix: disable metadata enable for empty/bootloader devices #9288

Merged
merged 1 commit into from
Aug 30, 2023

Conversation

mroz22
Copy link
Contributor

@mroz22 mroz22 commented Aug 28, 2023

When doing #9130 I accidentally discovered a little bug. When you get into application settings with device which is not initialized, it is still possible to click "enable labeling". This feature however requires call to device which is not possible for such device. As a quick fix I suggest disabling this button as this action would fail anyway.

@@ -40,7 +40,7 @@ export const Labeling = () => {
// - Labeling enabled without any device connected
// - Labeling enabled with the device connected inside Settings
// The initialization of Labeling then start when user select a Wallet.
const isDisabled = !!device && !metadata.enabled && isLocked();
const isDisabled = (!!device && !metadata.enabled && isLocked()) || device?.mode !== 'normal';
Copy link
Member

Choose a reason for hiding this comment

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

What about this?

Suggested change
const isDisabled = (!!device && !metadata.enabled && isLocked()) || device?.mode !== 'normal';
const isDisabled = !!device && !metadata.enabled && (isLocked() || device?.mode !== 'normal');

So with empty/bootloader device I can still disable the labeling, but enabling is not allowed?

@matejkriz matejkriz self-assigned this Aug 28, 2023
Copy link
Member

@matejkriz matejkriz left a comment

Choose a reason for hiding this comment

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

it's enhancement and edge case, so I'll merge it now, but would be nice to rethink/redesign the process of enabling/disabling labeling completely so it doesn't depend on the device

@matejkriz matejkriz merged commit 124e23c into develop Aug 30, 2023
6 checks passed
@matejkriz matejkriz deleted the chore/metadata-refactoring-4 branch August 30, 2023 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants