fix(backup): don't pass click event as legacy password
addEventListener('click', doBackupImport) was passing the MouseEvent
as the first argument, which got forwarded to pbkdf2 as an Object.
This commit is contained in:
parent
e3c8ccdca4
commit
161357522e
@ -1200,12 +1200,13 @@ function askLegacyBackupPassword() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function doBackupImport(legacyPassword) {
|
async function doBackupImport(legacyPassword) {
|
||||||
|
const pw = typeof legacyPassword === 'string' ? legacyPassword : undefined;
|
||||||
try {
|
try {
|
||||||
const result = await window.api.importBackup(legacyPassword);
|
const result = await window.api.importBackup(pw);
|
||||||
if (!result || result.canceled) return;
|
if (!result || result.canceled) return;
|
||||||
if (result.needsPassword) {
|
if (result.needsPassword) {
|
||||||
const pw = await askLegacyBackupPassword();
|
const entered = await askLegacyBackupPassword();
|
||||||
if (pw) doBackupImport(pw);
|
if (entered) doBackupImport(entered);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (result.ok) {
|
if (result.ok) {
|
||||||
@ -2311,8 +2312,8 @@ function renderSettings() {
|
|||||||
arrow.innerHTML = isOpen ? '▶' : '▼';
|
arrow.innerHTML = isOpen ? '▶' : '▼';
|
||||||
});
|
});
|
||||||
|
|
||||||
document.getElementById('exportBackupBtn').addEventListener('click', doBackupExport);
|
document.getElementById('exportBackupBtn').addEventListener('click', () => doBackupExport());
|
||||||
document.getElementById('importBackupBtn').addEventListener('click', doBackupImport);
|
document.getElementById('importBackupBtn').addEventListener('click', () => doBackupImport());
|
||||||
|
|
||||||
// --- Separator before hoster panels ---
|
// --- Separator before hoster panels ---
|
||||||
const separator = document.createElement('div');
|
const separator = document.createElement('div');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user