Update BlueApp.js

This commit is contained in:
Marcos Rodriguez Velez 2024-03-06 23:20:20 -04:00
parent 41a277e675
commit cb375c3a70
No known key found for this signature in database
GPG key ID: 6030B2F48CCE86D7

View file

@ -885,7 +885,9 @@ class AppStorage {
async deleteRealmFilesFromDefaultDirectory() {
const documentsPath = RNFS.DocumentDirectoryPath; // Path to documents folder
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
if (Array.isArray(files) && files.length === 0) return; // If there are no files, return (nothing to delete
const appRealmFiles = files.filter(
file => file.name.endsWith('.realm') || file.name.endsWith('.realm.lock') || file.name.includes('.realm.management'),
);