This commit is contained in:
Sosthene00 2024-04-17 09:14:00 +02:00
parent 18f159696b
commit 8e60ec6ef0

View File

@ -128,7 +128,6 @@ class Services {
public async recover(event: Event) { public async recover(event: Event) {
event.preventDefault(); event.preventDefault();
console.log("JS recover submit ");
const passwordElement = document.getElementById("password") as HTMLInputElement; const passwordElement = document.getElementById("password") as HTMLInputElement;
const processElement = document.getElementById("selectProcess") as HTMLSelectElement; const processElement = document.getElementById("selectProcess") as HTMLSelectElement;
@ -140,12 +139,25 @@ class Services {
const password = passwordElement.value; const password = passwordElement.value;
const process = processElement.value; const process = processElement.value;
console.log("JS password: " + password + " process: " + process); // console.log("JS password: " + password + " process: " + process);
// To comment if test // To comment if test
// if (!Services.instance.isPasswordValid(password)) return; // if (!Services.instance.isPasswordValid(password)) return;
// TODO // Get user in db
alert("Recover submit to do ..."); const services = await Services.getInstance();
try {
const user = await services.getUserInfo();
if (user) {
services.sdkClient.login_user(password, user.pre_id, user.recover_data, user.shares, user.outputs);
this.sp_address = services.sdkClient.get_receiving_address(user?.pre_id);
}
} catch (error) {
console.error(error);
}
// TODO: check blocks since last_scan and update outputs
await services.displaySendMessage();
} }
public async displayRevokeImage(revokeData: Uint8Array): Promise<void> { public async displayRevokeImage(revokeData: Uint8Array): Promise<void> {