mirror of
https://github.com/BlueWallet/BlueWallet.git
synced 2024-11-19 09:50:15 +01:00
FIX: Cache destination
This commit is contained in:
parent
cb375c3a70
commit
1ac7354d24
@ -883,17 +883,17 @@ class AppStorage {
|
||||
}
|
||||
|
||||
async deleteRealmFilesFromDefaultDirectory() {
|
||||
const documentsPath = RNFS.DocumentDirectoryPath; // Path to documents folder
|
||||
const cachesPath = RNFS.CachesDirectoryPath; // Path to caches 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 (!(await RNFS.exists(cachesPath))) return; // If the caches directory does not exist, return (nothing to delete)
|
||||
const files = await RNFS.readDir(cachesPath); // Read all files in caches 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'),
|
||||
);
|
||||
|
||||
for (const file of appRealmFiles) {
|
||||
const filePath = `${documentsPath}/${file.name}`;
|
||||
const filePath = `${cachesPath}/${file.name}`;
|
||||
const fileExists = await RNFS.exists(filePath); // Check if the file exists
|
||||
if (fileExists) {
|
||||
await RNFS.unlink(filePath); // Delete the file if it exists
|
||||
|
@ -25,7 +25,7 @@ let _realm;
|
||||
async function _getRealm() {
|
||||
if (_realm) return _realm;
|
||||
|
||||
const tempFolderPath = RNFS.TemporaryDirectoryPath; // Path to temporary folder
|
||||
const tempFolderPath = RNFS.CachesDirectoryPath; // Path to temporary folder
|
||||
const password = bitcoin.crypto.sha256(Buffer.from('fyegjitkyf[eqjnc.lf')).toString('hex');
|
||||
const buf = Buffer.from(password + password, 'hex');
|
||||
const encryptionKey = Int8Array.from(buf);
|
||||
|
Loading…
Reference in New Issue
Block a user