Compare commits
2 Commits
96ee5b03e6
...
f7b9129401
| Author | SHA1 | Date | |
|---|---|---|---|
| f7b9129401 | |||
| 09b1c29788 |
@ -66,7 +66,6 @@ export class WalletService {
|
|||||||
throw new Error(`[WalletService] Échec: ${e}`);
|
throw new Error(`[WalletService] Échec: ${e}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// -------------------------
|
|
||||||
|
|
||||||
public async saveDeviceInDatabase(device: Device): Promise<void> {
|
public async saveDeviceInDatabase(device: Device): Promise<void> {
|
||||||
await this.db.saveDevice(device);
|
await this.db.saveDevice(device);
|
||||||
|
|||||||
@ -516,7 +516,6 @@ export class IframeController {
|
|||||||
|
|
||||||
// Nous appelons handleApiReturn ici, comme avant.
|
// Nous appelons handleApiReturn ici, comme avant.
|
||||||
await services.handleApiReturn(res);
|
await services.handleApiReturn(res);
|
||||||
// --- FIN DE LA MODIFICATION ---
|
|
||||||
|
|
||||||
window.parent.postMessage(
|
window.parent.postMessage(
|
||||||
{
|
{
|
||||||
|
|||||||
@ -37,6 +37,8 @@ export default class Services {
|
|||||||
// Utilisation de la config
|
// Utilisation de la config
|
||||||
this.networkService = new NetworkService(APP_CONFIG.URLS.BOOTSTRAP);
|
this.networkService = new NetworkService(APP_CONFIG.URLS.BOOTSTRAP);
|
||||||
this.cryptoService = new CryptoService(this.sdkService);
|
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> {
|
public static async getInstance(): Promise<Services> {
|
||||||
@ -696,7 +698,7 @@ export default class Services {
|
|||||||
const dev = await this.walletService.getDeviceFromDatabase();
|
const dev = await this.walletService.getDeviceFromDatabase();
|
||||||
if (dev && dev.pairing_process_commitment === pid) {
|
if (dev && dev.pairing_process_commitment === pid) {
|
||||||
const last = updated.current_process.states[updated.current_process.states.length - 1];
|
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> {
|
export async function storeData(servers: string[], key: string, value: Blob, ttl: number | null): Promise<AxiosResponse | null> {
|
||||||
for (const server of servers) {
|
for (const server of servers) {
|
||||||
try {
|
try {
|
||||||
// --- DÉBUT DE LA CORRECTION ---
|
|
||||||
// 1. On vérifie d'abord si la donnée existe en appelant le bon service
|
// 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
|
// On passe 'server' au lieu de 'url' pour que testData construise la bonne URL
|
||||||
const dataExists = await testData(server, key);
|
const dataExists = await testData(server, key);
|
||||||
@ -14,7 +13,6 @@ export async function storeData(servers: string[], key: string, value: Blob, ttl
|
|||||||
} else {
|
} else {
|
||||||
console.log('Data not stored for server, proceeding to POST:', key, server);
|
console.log('Data not stored for server, proceeding to POST:', key, server);
|
||||||
}
|
}
|
||||||
// --- FIN DE LA CORRECTION ---
|
|
||||||
|
|
||||||
|
|
||||||
// Construction de l'URL pour le POST (stockage)
|
// Construction de l'URL pour le POST (stockage)
|
||||||
@ -112,7 +110,6 @@ interface TestResponse {
|
|||||||
value: boolean;
|
value: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
// --- FONCTION testData CORRIGÉE ---
|
|
||||||
// Elle prend 'server' au lieu de 'url' et construit sa propre URL '/test/...'
|
// Elle prend 'server' au lieu de 'url' et construit sa propre URL '/test/...'
|
||||||
export async function testData(server: string, key: string): Promise<boolean> {
|
export async function testData(server: string, key: string): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user