feat(ext/generator): colorize live password preview
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
import { sendMessage } from '../../shared/state';
|
||||
import type { GeneratorRequest, VaultSettings } from '../../shared/types';
|
||||
import { colorizePassword } from '../../shared/password-coloring';
|
||||
|
||||
interface UiKnobs {
|
||||
kind: 'random' | 'bip39';
|
||||
@@ -138,7 +139,10 @@ export function openGeneratorPanel(opts: OpenPanelOpts): void {
|
||||
const d = resp.data as { password?: string; passphrase?: string };
|
||||
currentPreview = d.password ?? d.passphrase ?? '';
|
||||
const el = host.querySelector('.preview__value');
|
||||
if (el) el.textContent = currentPreview;
|
||||
if (el) {
|
||||
el.textContent = '';
|
||||
el.appendChild(colorizePassword(currentPreview));
|
||||
}
|
||||
updateValidation();
|
||||
}
|
||||
}, 150);
|
||||
|
||||
Reference in New Issue
Block a user