chore: hotfix for browser client

This commit is contained in:
Daniel Avila 2023-03-20 01:35:02 -04:00
parent 0405206438
commit 80ca3bc375
3 changed files with 21 additions and 5 deletions

View file

@ -190,13 +190,19 @@ module.exports = {
}
},
getConvo,
/* chore: this method is not properly error handled */
getConvoTitle: async (user, conversationId) => {
try {
const convo = await getConvo(user, conversationId);
return convo.title;
/* ChatGPT Browser was triggering error here due to convo being saved later */
if (convo && !convo.title) {
return null;
} else {
return convo.title;
}
} catch (error) {
console.log(error);
return { message: 'Error getting conversation title' };
return 'Error getting conversation title';
}
},
deleteConvos: async (user, filter) => {