Enhance payment processing and rental features

- Updated the BTCPay service to support internal Lightning invoices with private route hints, improving payment routing for users with private channels.
- Added reconciliation methods for pending rents and subscriptions to ensure missed payments are processed on startup.
- Enhanced the rental and subscription services to handle payments in satoshis, aligning with Lightning Network standards.
- Improved the rental modal and content detail components to display rental status and pricing more clearly, including a countdown for rental expiration.
- Refactored various components to streamline user experience and ensure accurate rental access checks.
This commit is contained in:
Dorian
2026-02-12 23:24:25 +00:00
parent cdd24a5def
commit 0da83f461c
39 changed files with 1182 additions and 270 deletions

View File

@@ -34,22 +34,33 @@ NostrConnectSigner.publishMethod = (relays, event) => {
}
/**
* Load saved accounts from localStorage
* Load saved accounts from localStorage.
* When no saved data exists (e.g. site data was cleared),
* explicitly reset the accountManager so stale in-memory
* state doesn't keep the UI in a "logged in" limbo.
*/
export function loadAccounts() {
try {
const saved = localStorage.getItem(STORAGE_KEY)
if (saved) {
const accounts = JSON.parse(saved)
accountManager.fromJSON(accounts, true)
if (!saved) {
// Nothing persisted — make sure the manager is clean.
// This handles partial site-data clears and HMR reloads.
const current = accountManager.active
if (current) {
try { accountManager.removeAccount(current) } catch { /* noop */ }
}
return
}
// Restore active account
const activeId = localStorage.getItem(ACTIVE_KEY)
if (activeId) {
const account = accountManager.getAccount(activeId)
if (account) {
accountManager.setActive(account)
}
const accounts = JSON.parse(saved)
accountManager.fromJSON(accounts, true)
// Restore active account
const activeId = localStorage.getItem(ACTIVE_KEY)
if (activeId) {
const account = accountManager.getAccount(activeId)
if (account) {
accountManager.setActive(account)
}
}
} catch (e) {