debug: add error surfacing for notes-to-self creation
This commit is contained in:
@@ -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>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user