update delete wallet function to handle wallet isar data

This commit is contained in:
julian 2023-01-16 17:00:32 -06:00
parent 203cd12678
commit 880c82ba72

View file

@ -3,6 +3,7 @@ import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_libmonero/monero/monero.dart'; import 'package:flutter_libmonero/monero/monero.dart';
import 'package:flutter_libmonero/wownero/wownero.dart'; import 'package:flutter_libmonero/wownero/wownero.dart';
import 'package:stackwallet/db/main_db.dart';
import 'package:stackwallet/hive/db.dart'; import 'package:stackwallet/hive/db.dart';
import 'package:stackwallet/services/coins/epiccash/epiccash_wallet.dart'; import 'package:stackwallet/services/coins/epiccash/epiccash_wallet.dart';
import 'package:stackwallet/services/notifications_service.dart'; import 'package:stackwallet/services/notifications_service.dart';
@ -385,6 +386,9 @@ class WalletsService extends ChangeNotifier {
level: LogLevel.Info); level: LogLevel.Info);
} }
// delete wallet data in main db
await MainDB.instance.deleteWalletBlockchainData(walletId);
// box data may currently still be read/written to if wallet was refreshing // box data may currently still be read/written to if wallet was refreshing
// when delete was requested so instead of deleting now we mark the wallet // when delete was requested so instead of deleting now we mark the wallet
// as needs delete by adding it's id to a list which gets checked on app start // as needs delete by adding it's id to a list which gets checked on app start