Fixes for backups for Android. Fixes for send almost all amount.

This commit is contained in:
M
2021-01-29 22:18:07 +02:00
parent 5631961e47
commit 2ce34919bf
10 changed files with 60 additions and 21 deletions
+4 -2
View File
@@ -1,5 +1,4 @@
import 'dart:io';
import 'package:cake_wallet/core/backup_service.dart';
import 'package:cake_wallet/core/execution_state.dart';
import 'package:cake_wallet/entities/secret_store_key.dart';
@@ -7,6 +6,7 @@ import 'package:cake_wallet/store/secret_store.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter_secure_storage/flutter_secure_storage.dart';
import 'package:mobx/mobx.dart';
import 'package:intl/intl.dart';
part 'backup_view_model.g.dart';
@@ -56,9 +56,11 @@ abstract class BackupViewModelBase with Store {
state = IsExecutingState();
final backupContent = await backupService.exportBackup(backupPassword);
state = ExecutedSuccessfullyState();
final now = DateTime.now();
final formatter = DateFormat('yyyy-MM-dd_Hm');
return BackupExportFile(backupContent.toList(),
name: 'backup_${DateTime.now().toString()}.zip');
name: 'cake_wallet_backup_${formatter.format(now)}');
} catch (e) {
print(e.toString());
state = FailureState(e.toString());
+1
View File
@@ -167,6 +167,7 @@ abstract class SendViewModelBase with Store {
Validator get templateValidator => TemplateValidator();
@observable
PendingTransaction pendingTransaction;
@computed