refactor(services): remove commented-out code and improve code clarity in iframe-controller, storage, and wallet services

This commit is contained in:
NicolasCantu 2025-11-28 10:44:17 +01:00
parent 96ee5b03e6
commit 09b1c29788
3 changed files with 0 additions and 5 deletions

View File

@ -66,7 +66,6 @@ export class WalletService {
throw new Error(`[WalletService] Échec: ${e}`);
}
}
// -------------------------
public async saveDeviceInDatabase(device: Device): Promise<void> {
await this.db.saveDevice(device);

View File

@ -516,7 +516,6 @@ export class IframeController {
// Nous appelons handleApiReturn ici, comme avant.
await services.handleApiReturn(res);
// --- FIN DE LA MODIFICATION ---
window.parent.postMessage(
{

View File

@ -3,7 +3,6 @@ import axios, { AxiosResponse } from 'axios';
export async function storeData(servers: string[], key: string, value: Blob, ttl: number | null): Promise<AxiosResponse | null> {
for (const server of servers) {
try {
// --- DÉBUT DE LA CORRECTION ---
// 1. On vérifie d'abord si la donnée existe en appelant le bon service
// On passe 'server' au lieu de 'url' pour que testData construise la bonne URL
const dataExists = await testData(server, key);
@ -14,7 +13,6 @@ export async function storeData(servers: string[], key: string, value: Blob, ttl
} else {
console.log('Data not stored for server, proceeding to POST:', key, server);
}
// --- FIN DE LA CORRECTION ---
// Construction de l'URL pour le POST (stockage)
@ -112,7 +110,6 @@ interface TestResponse {
value: boolean;
}
// --- FONCTION testData CORRIGÉE ---
// Elle prend 'server' au lieu de 'url' et construit sa propre URL '/test/...'
export async function testData(server: string, key: string): Promise<boolean> {
try {