mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-27 06:18:50 +01:00
cw-1584-ironwood-migration-modal (#3481)
* ironwood migration modal * auto-show when migration begins * remove restricted import * new condition * string fix * only activate if ironwood is active * reaction safeguards * migration*
This commit is contained in:
@@ -96,6 +96,7 @@ abstract class DashboardViewModelBase with Store {
|
||||
isShowFirstYatIntroduction = false,
|
||||
isShowSecondYatIntroduction = false,
|
||||
isShowThirdYatIntroduction = false,
|
||||
isMigratingToIronwood = false,
|
||||
filterItems = [],
|
||||
exchangeFilterItems = [],
|
||||
subname = '',
|
||||
@@ -250,6 +251,8 @@ abstract class DashboardViewModelBase with Store {
|
||||
|
||||
reaction((_) => tradesStore.trades, (_) => tradeMonitor.monitorActiveTrades(wallet.id));
|
||||
|
||||
addZcashMigrationReaction();
|
||||
|
||||
tradeMonitor.monitorActiveTrades(wallet.id);
|
||||
}
|
||||
|
||||
@@ -374,6 +377,22 @@ abstract class DashboardViewModelBase with Store {
|
||||
);
|
||||
}
|
||||
|
||||
@observable
|
||||
ReactionDisposer? zcashMigrationReactionDisposer;
|
||||
|
||||
@action
|
||||
void addZcashMigrationReaction() {
|
||||
zcashMigrationReactionDisposer?.reaction.dispose();
|
||||
zcashMigrationReactionDisposer = null;
|
||||
|
||||
if (wallet.type == WalletType.zcash) {
|
||||
zcashMigrationReactionDisposer = reaction((_) => wallet.balance.values.first, (_) async {
|
||||
isMigratingToIronwood =
|
||||
wallet.type == WalletType.zcash && await zcash!.hasOrchardMigratableBalance(wallet);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@computed
|
||||
bool get isSyncHeavy {
|
||||
if ([
|
||||
@@ -1270,6 +1289,8 @@ abstract class DashboardViewModelBase with Store {
|
||||
name = wallet.name;
|
||||
loadFilterItems();
|
||||
|
||||
addZcashMigrationReaction();
|
||||
|
||||
if (wallet.type == WalletType.monero) {
|
||||
subname = monero!.getCurrentAccount(wallet).label;
|
||||
|
||||
@@ -1551,6 +1572,9 @@ abstract class DashboardViewModelBase with Store {
|
||||
}
|
||||
}
|
||||
|
||||
@observable
|
||||
bool isMigratingToIronwood;
|
||||
|
||||
String getTransactionType(TransactionInfo tx) {
|
||||
if (wallet.type == WalletType.bitcoin) {
|
||||
if (tx.isReplaced == true) return ' (replaced)';
|
||||
|
||||
Reference in New Issue
Block a user