Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 2 additions & 3 deletions app_theme/lib/src/light/theme_custom_light.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,9 @@ class ThemeCustomLight extends ThemeExtension<ThemeCustomLight>

@override
late final Color suspendedBannerBackgroundColor;
@override
late final Color keyPadColor;

void initializeThemeDependentColors(ThemeData theme) {
suspendedBannerBackgroundColor = theme.colorScheme.onSurface;
keyPadColor = theme.colorScheme.onSurface;
}

@override
Expand Down Expand Up @@ -213,6 +210,8 @@ class ThemeCustomLight extends ThemeExtension<ThemeCustomLight>
final bridgeFormHeader = const TextStyle(
fontSize: 11, fontWeight: FontWeight.w500, letterSpacing: 3.5);
@override
final Color keyPadColor = const Color.fromRGBO(251, 251, 251, 1);
@override
final Color keyPadTextColor = const Color.fromRGBO(129, 151, 182, 1);
@override
final Color dialogBarrierColor = const Color.fromRGBO(3, 26, 43, 0.36);
Expand Down
21 changes: 12 additions & 9 deletions lib/bloc/auth_bloc/trezor_auth_mixin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ mixin TrezorAuthMixin on Bloc<AuthBlocEvent, AuthBlocState> {
_log.shout('Trezor authentication failed', e);
emit(
AuthBlocState.error(
AuthException(
e.toString(),
type: AuthExceptionType.generalAuthError,
),
AuthException(e.toString(), type: AuthExceptionType.generalAuthError),
),
);
}
Expand All @@ -75,7 +72,8 @@ mixin TrezorAuthMixin on Bloc<AuthBlocEvent, AuthBlocState> {
);
case AuthenticationStatus.waitingForDeviceConfirmation:
return AuthBlocState.trezorAwaitingConfirmation(
message: authState.message ??
message:
authState.message ??
'Please follow instructions on your Trezor device',
taskId: authState.taskId,
);
Expand Down Expand Up @@ -191,10 +189,7 @@ mixin TrezorAuthMixin on Bloc<AuthBlocEvent, AuthBlocState> {
return;
}

await _sdk.auth.setHardwareDevicePassphrase(
taskId,
event.passphrase,
);
await _sdk.auth.setHardwareDevicePassphrase(taskId, event.passphrase);
} catch (e) {
_log.shout('Failed to provide passphrase', e);
emit(
Expand All @@ -212,6 +207,14 @@ mixin TrezorAuthMixin on Bloc<AuthBlocEvent, AuthBlocState> {
AuthTrezorCancelled event,
Emitter<AuthBlocState> emit,
) async {
final taskId = state.authenticationState?.taskId;
if (taskId != null) {
try {
await _sdk.auth.cancelHardwareDeviceInitialization(taskId);
} catch (e) {
_log.shout('Failed to cancel Trezor initialization', e);
}
}
emit(AuthBlocState.initial());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ Future<void> showTrezorPinDialog(TrezorTask task) async {
authBloc.add(AuthTrezorPinProvided(pin));
close();
},
onClose: close,
onClose: () {
context.read<AuthBloc>().add(AuthTrezorCancelled());
close();
},
),
);

Expand Down
Loading