Commit 8bd55074 authored by Wilko Manger's avatar Wilko Manger

Simplify delete method

parent 5748c621
......@@ -9,7 +9,6 @@
library matrix_sdk_sqflite;
import 'dart:convert';
import 'dart:io';
import 'package:matrix_sdk/matrix_sdk.dart';
import 'package:meta/meta.dart';
......@@ -303,21 +302,7 @@ class SqfliteStore implements Store {
Future<void> delete() async {
await close();
final path = !this.path.startsWith('/') ? '/${this.path}' : this.path;
final fullPath = await getDatabasesPath() + path;
final files = [
File(fullPath),
File('$fullPath-journal'),
File('$fullPath-wal'),
File('$fullPath-shm'),
];
for (final file in files) {
if (await file.exists()) {
await file.delete();
}
}
await deleteDatabase(path);
}
@override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment