backward compatibility version 1 wallet

This commit is contained in:
PhilReact 2024-12-19 23:42:21 +02:00
parent 06f7482652
commit fd907e1c9c
3 changed files with 3 additions and 3 deletions

View File

@ -695,7 +695,7 @@ function App() {
let wallet = structuredClone(rawWallet);
const res = await decryptStoredWallet(password, wallet);
const wallet2 = new PhraseWallet(res, walletVersion);
const wallet2 = new PhraseWallet(res, wallet?.version || walletVersion);
wallet = await wallet2.generateSaveWalletData(
password,
crypto.kdfThreads,

View File

@ -232,7 +232,7 @@ export async function userInfoCase(request, event) {
export async function decryptWalletCase(request, event) {
try {
const { password, wallet } = request.payload;
const response = await decryptWallet({password, wallet, walletVersion});
const response = await decryptWallet({password, wallet, walletVersion: wallet?.version || walletVersion});
event.source.postMessage(
{
requestId: request.requestId,

View File

@ -2147,7 +2147,7 @@ export async function sendCoin(
};
} else {
const response = await decryptStoredWallet(password, wallet);
const wallet2 = new PhraseWallet(response, walletVersion);
const wallet2 = new PhraseWallet(response, wallet?.version || walletVersion);
keyPair = wallet2._addresses[0].keyPair;
}