dev vouch dev on at. thats about it atvouch.dev
8
fork

Configure Feed

Select the types of activity you want to include in your feed.

show invalid records to user so they can remove it

Luna b0c67ba3 38cae5ff

+23 -16
+11 -5
frontend/src/App.tsx
··· 195 195 <ul className="vouch-list"> 196 196 {vouches?.map((v) => ( 197 197 <li key={v.rkey}> 198 - <span className="vouch-handle">{v.handle ?? v.did}</span> 199 - <span className="vouch-date"> 200 - {new Date(v.createdAt).toISOString().slice(0, 10)} 201 - </span> 198 + {v.valid ? ( 199 + <> 200 + <span className="vouch-handle">{v.handle ?? v.did}</span> 201 + <span className="vouch-date"> 202 + {new Date(v.createdAt).toISOString().slice(0, 10)} 203 + </span> 204 + </> 205 + ) : ( 206 + <span className="vouch-handle vouch-invalid">INVALID</span> 207 + )} 202 208 <button 203 209 className="vouch-delete" 204 210 title="Delete vouch" 205 211 onClick={async () => { 206 - if (!confirm(`Remove vouch for ${v.handle ?? v.did}?`)) return; 212 + if (!confirm(v.valid ? `Remove vouch for ${v.handle ?? v.did}?` : `Delete invalid record?`)) return; 207 213 await deleteVouch(agent, v.rkey); 208 214 refreshVouches(); 209 215 }}
+12 -11
frontend/src/api.ts
··· 126 126 handle: string | null; 127 127 createdAt: string; 128 128 rkey: string; 129 + valid: boolean; 129 130 } 130 131 131 132 export async function listVouches(agent: OAuthUserAgent): Promise<VouchEntry[]> { ··· 149 150 }; 150 151 151 152 for (const rec of data.records) { 152 - if (rec.value.subject) { 153 - const rkey = rec.uri.split("/").pop()!; 154 - entries.push({ 155 - did: rec.value.subject, 156 - handle: null, 157 - createdAt: rec.value.createdAt, 158 - rkey, 159 - }); 160 - } 153 + const rkey = rec.uri.split("/").pop()!; 154 + const valid = rkey.startsWith("did:") && rkey === rec.value.subject; 155 + entries.push({ 156 + did: rec.value.subject, 157 + handle: null, 158 + createdAt: rec.value.createdAt, 159 + rkey, 160 + valid, 161 + }); 161 162 } 162 163 163 164 if (!data.cursor) break; 164 165 cursor = data.cursor; 165 166 } 166 167 167 - // Resolve DIDs to handles 168 + // Resolve DIDs to handles (only for valid entries) 168 169 await Promise.all( 169 - entries.map(async (entry) => { 170 + entries.filter((e) => e.valid).map(async (entry) => { 170 171 try { 171 172 entry.handle = await resolveDidToHandle(entry.did); 172 173 } catch {