mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-11-28 11:34:52 +01:00
Cw 150 cake pay introduction card (#486)
* create introducing card * add ability to close the card * update walletInfo class * update localization * fix intro text * fix card size * show card for existing and new wallet types * disable card for haven wallets * fixes to PR * fixes to PR * fix PR
This commit is contained in:
@@ -39,6 +39,7 @@ abstract class BalanceViewModelBase with Store {
|
||||
@required this.fiatConvertationStore}) {
|
||||
isReversing = false;
|
||||
wallet ??= appStore.wallet;
|
||||
isShowCard = wallet.walletInfo.isShowIntroCakePayCard;
|
||||
reaction((_) => appStore.wallet, _onWalletChange);
|
||||
}
|
||||
|
||||
@@ -235,6 +236,9 @@ abstract class BalanceViewModelBase with Store {
|
||||
@computed
|
||||
CryptoCurrency get currency => appStore.wallet.currency;
|
||||
|
||||
@observable
|
||||
bool isShowCard;
|
||||
|
||||
ReactionDisposer _onCurrentWalletChangeReaction;
|
||||
|
||||
@action
|
||||
@@ -244,6 +248,15 @@ abstract class BalanceViewModelBase with Store {
|
||||
wallet) {
|
||||
this.wallet = wallet;
|
||||
_onCurrentWalletChangeReaction?.reaction?.dispose();
|
||||
isShowCard = wallet.walletInfo.isShowIntroCakePayCard;
|
||||
}
|
||||
|
||||
@action
|
||||
Future<void> disableIntroCakePayCard () async {
|
||||
const cardDisplayStatus = false;
|
||||
wallet.walletInfo.showIntroCakePayCard = cardDisplayStatus;
|
||||
await wallet.walletInfo.save();
|
||||
isShowCard = cardDisplayStatus;
|
||||
}
|
||||
|
||||
String _getFiatBalance({double price, String cryptoAmount}) {
|
||||
|
||||
@@ -37,6 +37,9 @@ abstract class WalletCreationVMBase with Store {
|
||||
bool nameExists(String name)
|
||||
=> walletCreationService.exists(name);
|
||||
|
||||
bool typeExists(WalletType type)
|
||||
=> walletCreationService.typeExists(type);
|
||||
|
||||
Future<void> create({dynamic options}) async {
|
||||
try {
|
||||
state = IsExecutingState();
|
||||
@@ -56,7 +59,8 @@ abstract class WalletCreationVMBase with Store {
|
||||
restoreHeight: credentials.height ?? 0,
|
||||
date: DateTime.now(),
|
||||
path: path,
|
||||
dirPath: dirPath);
|
||||
dirPath: dirPath,
|
||||
showIntroCakePayCard: (!walletCreationService.typeExists(type)) && type != WalletType.haven);
|
||||
credentials.walletInfo = walletInfo;
|
||||
final wallet = await process(credentials);
|
||||
walletInfo.address = wallet.walletAddresses.address;
|
||||
|
||||
Reference in New Issue
Block a user