debug: add error surfacing for notes-to-self creation

This commit is contained in:
2026-07-02 08:40:07 -04:00
parent a5c3b25cc0
commit 3ed66f3d43
+10 -1
View File
@@ -25,7 +25,10 @@ export function ConversationList() {
fetchConversations();
}, [fetchConversations]);
const [notesError, setNotesError] = useState<string | null>(null);
const openNotes = async () => {
setNotesError(null);
// Find existing self-DM or create one
const existing = conversations.find((c) => isSelfDM(c, currentUser?.id || ""));
if (existing) {
@@ -34,7 +37,10 @@ export function ConversationList() {
}
try {
await createConversation([]);
} catch { /* ignore */ }
} catch (err) {
console.error('Failed to create notes:', err);
setNotesError(err instanceof Error ? err.message : 'Failed to create notes');
}
};
return (
@@ -85,6 +91,9 @@ export function ConversationList() {
);
})}
</div>
{notesError && (
<div className="px-3 py-1 text-gb-red text-xs font-mono">ERR: {notesError}</div>
)}
{showNew && <NewConversationModal onClose={() => setShowNew(false)} />}
</div>
);