mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-03-22 23:28:53 +00:00
Hack for display login issue
This commit is contained in:
parent
52c5d11787
commit
4e4cd08135
3 changed files with 22 additions and 9 deletions
|
@ -2,12 +2,14 @@ import 'package:cake_wallet/bitcoin/bitcoin_wallet_service.dart';
|
||||||
import 'package:cake_wallet/core/wallet_service.dart';
|
import 'package:cake_wallet/core/wallet_service.dart';
|
||||||
import 'package:cake_wallet/entities/biometric_auth.dart';
|
import 'package:cake_wallet/entities/biometric_auth.dart';
|
||||||
import 'package:cake_wallet/entities/contact_record.dart';
|
import 'package:cake_wallet/entities/contact_record.dart';
|
||||||
|
import 'package:cake_wallet/entities/load_current_wallet.dart';
|
||||||
import 'package:cake_wallet/entities/transaction_description.dart';
|
import 'package:cake_wallet/entities/transaction_description.dart';
|
||||||
import 'package:cake_wallet/entities/transaction_info.dart';
|
import 'package:cake_wallet/entities/transaction_info.dart';
|
||||||
import 'package:cake_wallet/monero/monero_wallet_service.dart';
|
import 'package:cake_wallet/monero/monero_wallet_service.dart';
|
||||||
import 'package:cake_wallet/entities/contact.dart';
|
import 'package:cake_wallet/entities/contact.dart';
|
||||||
import 'package:cake_wallet/entities/node.dart';
|
import 'package:cake_wallet/entities/node.dart';
|
||||||
import 'package:cake_wallet/exchange/trade.dart';
|
import 'package:cake_wallet/exchange/trade.dart';
|
||||||
|
import 'package:cake_wallet/reactions/on_authentication_state_change.dart';
|
||||||
|
|
||||||
import 'package:cake_wallet/src/screens/contact/contact_list_page.dart';
|
import 'package:cake_wallet/src/screens/contact/contact_list_page.dart';
|
||||||
import 'package:cake_wallet/src/screens/contact/contact_page.dart';
|
import 'package:cake_wallet/src/screens/contact/contact_page.dart';
|
||||||
|
@ -199,6 +201,11 @@ Future setup(
|
||||||
}
|
}
|
||||||
|
|
||||||
authPageState.changeProcessText('Loading the wallet');
|
authPageState.changeProcessText('Loading the wallet');
|
||||||
|
|
||||||
|
if (loginError != null) {
|
||||||
|
authPageState.changeProcessText('ERROR: ${loginError.toString()}');
|
||||||
|
}
|
||||||
|
|
||||||
ReactionDisposer _reaction;
|
ReactionDisposer _reaction;
|
||||||
_reaction = reaction((_) => appStore.wallet, (Object _) {
|
_reaction = reaction((_) => appStore.wallet, (Object _) {
|
||||||
_reaction?.reaction?.dispose();
|
_reaction?.reaction?.dispose();
|
||||||
|
|
|
@ -103,15 +103,15 @@ class MoneroWalletService extends WalletService<
|
||||||
final isValid = await wallet.validate();
|
final isValid = await wallet.validate();
|
||||||
|
|
||||||
if (!isValid) {
|
if (!isValid) {
|
||||||
if (wallet.seed?.isNotEmpty ?? false) {
|
// if (wallet.seed?.isNotEmpty ?? false) {
|
||||||
// let restore from seed in this case;
|
// let restore from seed in this case;
|
||||||
final seed = wallet.seed;
|
// final seed = wallet.seed;
|
||||||
final credentials = MoneroRestoreWalletFromSeedCredentials(
|
// final credentials = MoneroRestoreWalletFromSeedCredentials(
|
||||||
name: name, password: password, mnemonic: seed, height: 2000000)
|
// name: name, password: password, mnemonic: seed, height: 2000000)
|
||||||
..walletInfo = walletInfo;
|
// ..walletInfo = walletInfo;
|
||||||
await remove(name);
|
// await remove(name);
|
||||||
return restoreFromSeed(credentials);
|
// return restoreFromSeed(credentials);
|
||||||
}
|
// }
|
||||||
|
|
||||||
throw MoneroWalletLoadingException();
|
throw MoneroWalletLoadingException();
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +7,19 @@ import 'package:cake_wallet/store/authentication_store.dart';
|
||||||
|
|
||||||
ReactionDisposer _onAuthenticationStateChange;
|
ReactionDisposer _onAuthenticationStateChange;
|
||||||
|
|
||||||
|
dynamic loginError;
|
||||||
|
|
||||||
void startAuthenticationStateChange(AuthenticationStore authenticationStore,
|
void startAuthenticationStateChange(AuthenticationStore authenticationStore,
|
||||||
@required GlobalKey<NavigatorState> navigatorKey) {
|
@required GlobalKey<NavigatorState> navigatorKey) {
|
||||||
_onAuthenticationStateChange ??= autorun((_) async {
|
_onAuthenticationStateChange ??= autorun((_) async {
|
||||||
final state = authenticationStore.state;
|
final state = authenticationStore.state;
|
||||||
|
|
||||||
if (state == AuthenticationState.installed) {
|
if (state == AuthenticationState.installed) {
|
||||||
|
try {
|
||||||
await loadCurrentWallet();
|
await loadCurrentWallet();
|
||||||
|
} catch(e) {
|
||||||
|
loginError = e;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue