windows reset password DPS error fix

This commit is contained in:
shillo 2022-12-23 14:21:37 -06:00
parent c6dd9394be
commit f85d2895fc

View file

@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter_svg/svg.dart';
import 'package:hive/hive.dart';
import 'package:isar/isar.dart';
import 'package:stackwallet/hive/db.dart';
import 'package:stackwallet/notifications/show_flush_bar.dart';
import 'package:stackwallet/pages/intro_view.dart';
@ -42,7 +43,21 @@ class _ForgotPasswordDesktopViewState
try {
await Hive.close();
if (Platform.isWindows || Platform.isLinux) {
if (Platform.isWindows) {
final xmrDir = Directory("${appRoot.path}/wallets");
if (xmrDir.existsSync()) {
await xmrDir.delete(recursive: true);
}
final epicDir = Directory("${appRoot.path}/epiccash");
if (epicDir.existsSync()) {
await epicDir.delete(recursive: true);
}
await Isar.getInstance("desktopStore")?.close(deleteFromDisk: true);
await (await StackFileSystem.applicationHiveDirectory())
.delete(recursive: true);
} else if (Platform.isLinux) {
await appRoot.delete(recursive: true);
} else {
// macos in ipad mode