diff --git a/shared/components/rstack-identity.ts b/shared/components/rstack-identity.ts index 31313b3..b1e2c0a 100644 --- a/shared/components/rstack-identity.ts +++ b/shared/components/rstack-identity.ts @@ -712,6 +712,9 @@ export class RStackIdentity extends HTMLElement { let openSection: string | null = null; + // Account completion status + let acctStatus: { email: boolean; multiDevice: boolean; socialRecovery: boolean; guardianCount: number; credentialCount: number } | null = null; + // Lazy-loaded data let guardians: { id: string; name: string; email?: string; status: string }[] = []; let guardiansThreshold = 2; @@ -727,11 +730,36 @@ export class RStackIdentity extends HTMLElement { const close = () => overlay.remove(); + // Load account completion status + const loadStatus = async () => { + try { + const res = await fetch(`${ENCRYPTID_URL}/api/account/status`, { + headers: { Authorization: `Bearer ${getAccessToken()}` }, + }); + if (res.ok) { + acctStatus = await res.json(); + render(); + } + } catch { /* offline */ } + }; + loadStatus(); + + const statusDot = (done: boolean | null) => { + if (done === null) return ''; // still loading + return done + ? '' + : ''; + }; + const render = () => { const backupEnabled = isEncryptedBackupEnabled(); const currentTheme = localStorage.getItem("canvas-theme") || "dark"; const isDark = currentTheme === "dark"; + const emailDone = acctStatus ? acctStatus.email : null; + const deviceDone = acctStatus ? acctStatus.multiDevice : null; + const recoveryDone = acctStatus ? acctStatus.socialRecovery : null; + overlay.innerHTML = `
@@ -743,15 +771,18 @@ export class RStackIdentity extends HTMLElement { ${renderRecoverySection()} ${renderAddressSection()} -
+