mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2025-02-28 19:27:31 +01:00
Update BlueApp.js
This commit is contained in:
parent
41a277e675
commit
cb375c3a70
1 changed files with 2 additions and 0 deletions
|
@ -885,7 +885,9 @@ class AppStorage {
|
||||||
async deleteRealmFilesFromDefaultDirectory() {
|
async deleteRealmFilesFromDefaultDirectory() {
|
||||||
const documentsPath = RNFS.DocumentDirectoryPath; // Path to documents folder
|
const documentsPath = RNFS.DocumentDirectoryPath; // Path to documents folder
|
||||||
try {
|
try {
|
||||||
|
if (!(await RNFS.exists(documentsPath))) return; // If the documents directory does not exist, return (nothing to delete
|
||||||
const files = await RNFS.readDir(documentsPath); // Read all files in documents directory
|
const files = await RNFS.readDir(documentsPath); // Read all files in documents directory
|
||||||
|
if (Array.isArray(files) && files.length === 0) return; // If there are no files, return (nothing to delete
|
||||||
const appRealmFiles = files.filter(
|
const appRealmFiles = files.filter(
|
||||||
file => file.name.endsWith('.realm') || file.name.endsWith('.realm.lock') || file.name.includes('.realm.management'),
|
file => file.name.endsWith('.realm') || file.name.endsWith('.realm.lock') || file.name.includes('.realm.management'),
|
||||||
);
|
);
|
||||||
|
|
Loading…
Add table
Reference in a new issue