- Comprehensive logging system with chrome.storage.session persistence - NIP-07 action logging in background scripts with standalone functions - Vault operation logging (unlock, lock, create, reset, import, export) - Profile and bookmark operation logging - Logs page with refresh functionality and category icons - Lock button (🔒) in navigation bar to quickly lock vault - Reduced nav bar size (40px height, 16px font) with emoji icons - Reordered navigation: You, Permissions, Bookmarks, Logs, About, Lock - Bookmarks functionality for saving frequently used Nostr apps - Fixed lock/unlock flow by properly clearing in-memory session data 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
47 lines
1.3 KiB
TypeScript
47 lines
1.3 KiB
TypeScript
import { Component, inject, ViewChild } from '@angular/core';
|
|
import { FormsModule } from '@angular/forms';
|
|
import { Router } from '@angular/router';
|
|
import { LoggerService, NavComponent, StorageService, DerivingModalComponent } from '@common';
|
|
|
|
@Component({
|
|
selector: 'app-new',
|
|
imports: [FormsModule, DerivingModalComponent],
|
|
templateUrl: './new.component.html',
|
|
styleUrl: './new.component.scss',
|
|
})
|
|
export class NewComponent extends NavComponent {
|
|
@ViewChild('derivingModal') derivingModal!: DerivingModalComponent;
|
|
|
|
password = '';
|
|
|
|
readonly #router = inject(Router);
|
|
readonly #storage = inject(StorageService);
|
|
readonly #logger = inject(LoggerService);
|
|
|
|
toggleType(element: HTMLInputElement) {
|
|
if (element.type === 'password') {
|
|
element.type = 'text';
|
|
} else {
|
|
element.type = 'password';
|
|
}
|
|
}
|
|
|
|
async createVault() {
|
|
if (!this.password) {
|
|
return;
|
|
}
|
|
|
|
// Show deriving modal during key derivation (~3-6 seconds)
|
|
this.derivingModal.show('Creating secure vault');
|
|
try {
|
|
await this.#storage.createNewVault(this.password);
|
|
this.derivingModal.hide();
|
|
this.#logger.logVaultCreated();
|
|
this.#router.navigateByUrl('/home/identities');
|
|
} catch (error) {
|
|
this.derivingModal.hide();
|
|
console.error('Failed to create vault:', error);
|
|
}
|
|
}
|
|
}
|