Skip to content

Commit

Permalink
Merge branch 'onekey' into v4-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
huhuanming authored May 6, 2024
2 parents c2fdc4b + 5de3854 commit d533bcf
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions packages/kit/src/utils/hardware/deviceUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,9 @@ class DeviceUtils {
if (msg.indexOf('Failure_UnexpectedMessage') !== -1) {
return new Error.UnknownMethod(payload);
}
if (msg.indexOf('string overflow') !== -1) {
return new Error.NameExceedingMaximumLimit(payload);
}
return new Error.UnknownHardwareError(payload);
case HardwareErrorCode.PinInvalid:
return new Error.InvalidPIN(payload);
Expand Down
6 changes: 6 additions & 0 deletions packages/kit/src/utils/hardware/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,12 @@ export class UnknownMethod extends OneKeyHardwareError {
override key: LocaleIds = 'msg__hardware_unknown_message_error';
}

export class NameExceedingMaximumLimit extends OneKeyHardwareError {
override code = HardwareErrorCode.RuntimeError;

override key: LocaleIds = 'msg__exceeding_the_maximum_word_limit';
}

export class ConnectTimeout extends OneKeyHardwareError {
override key: LocaleIds = 'msg__hardware_connect_timeout_error';
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ const OnekeyHardwareDeviceName: FC<DeviceNameProps> = ({
control={control}
rules={{
maxLength: {
value: 16,
value: 32,
message: intl.formatMessage({
id: 'msg__exceeding_the_maximum_word_limit',
}),
Expand Down

0 comments on commit d533bcf

Please sign in to comment.