Handle push_to_storage in apiReturn

This commit is contained in:
NicolasCantu 2025-02-13 10:21:21 +01:00
parent 208da9b819
commit 422fa2469b

View File

@ -675,6 +675,22 @@ export default class Services {
}
}
if (apiReturn.push_to_storage && apiReturn.push_to_storage.length != 0) {
for (const hash of apiReturn.push_to_storage) {
try {
const value = await this.getBlobFromDb(hash);
console.log(value);
if (value) {
await this.saveDataToStorage(hash, value, null);
} else {
console.error('Failed to get data from db');
}
} catch (e) {
console.error(e);
}
}
}
if (apiReturn.commit_to_send) {
const commit = apiReturn.commit_to_send;
await this.sendCommitMessage(JSON.stringify(commit));