Compare commits
2 Commits
96ee5b03e6
...
f7b9129401
| Author | SHA1 | Date | |
|---|---|---|---|
| f7b9129401 | |||
| 09b1c29788 |
@ -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);
|
||||
|
||||
@ -516,7 +516,6 @@ export class IframeController {
|
||||
|
||||
// Nous appelons handleApiReturn ici, comme avant.
|
||||
await services.handleApiReturn(res);
|
||||
// --- FIN DE LA MODIFICATION ---
|
||||
|
||||
window.parent.postMessage(
|
||||
{
|
||||
|
||||
@ -37,6 +37,8 @@ export default class Services {
|
||||
// Utilisation de la config
|
||||
this.networkService = new NetworkService(APP_CONFIG.URLS.BOOTSTRAP);
|
||||
this.cryptoService = new CryptoService(this.sdkService);
|
||||
this.walletService = new WalletService(this.sdkService, null as any);
|
||||
this.processService = new ProcessService(this.sdkService, null as any);
|
||||
}
|
||||
|
||||
public static async getInstance(): Promise<Services> {
|
||||
@ -696,7 +698,7 @@ export default class Services {
|
||||
const dev = await this.walletService.getDeviceFromDatabase();
|
||||
if (dev && dev.pairing_process_commitment === pid) {
|
||||
const last = updated.current_process.states[updated.current_process.states.length - 1];
|
||||
if (last?.public_data['pairedAddresses']) await this.confirmPairing();
|
||||
// if (last?.public_data['pairedAddresses']) await this.confirmPairing();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user