Refactor chat page useEffect organization and improve compose intent handling

Reorganizes useEffect hooks in chat/page.tsx to follow a helper-functions-first structure, improving readability and maintainability. Adds error handling and user feedback for compose intent, preventing UI flash while processing. In send/route.ts, ensures remote user handles are fully qualified and adds debug logging. Temporarily disables key caching in keys/route.ts to address development key mismatches.
This commit is contained in:
Christopher
2026-01-28 07:37:27 -08:00
parent a21af87144
commit 93a587f185
3 changed files with 148 additions and 126 deletions
+7 -6
View File
@@ -46,12 +46,13 @@ export async function GET(request: NextRequest) {
),
});
if (cached) {
console.log('[Chat Keys GET] Found cached remote key');
return NextResponse.json({
publicKey: cached.publicKey,
});
}
// DEBUG: Force refresh for now to fix development key mismatches
// if (cached) {
// console.log('[Chat Keys GET] Found cached remote key');
// return NextResponse.json({
// publicKey: cached.publicKey,
// });
// }
// If not in cache, try to resolve DID to a node
console.log('[Chat Keys GET] resolving DID to node...');