From f08ffc35329bdb012e884f9e0753026cec066eb0 Mon Sep 17 00:00:00 2001 From: buddy-web3 <0buddy.ne@gmail.com> Date: Thu, 9 May 2024 06:24:23 +0300 Subject: [PATCH] inform Feedback type. Submit positive feedback --- app/components/Feedback/index.tsx | 5 ++++- app/routes/chat.log.ts | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/components/Feedback/index.tsx b/app/components/Feedback/index.tsx index 047384cb..6ff36793 100644 --- a/app/components/Feedback/index.tsx +++ b/app/components/Feedback/index.tsx @@ -57,7 +57,10 @@ const Feedback = ({ showText={!!labels} actionType={ActionType.HELPFUL} hint={upHint} - onClick={() => setShowFeedback(true)} + onClick={() => { + setShowFeedback(true) + onSubmit && onSubmit('', '') + }} /> { formData.append('file', fileBlob, 'question_and_response.html') const info = [ + option?.length > 0 ? ['Feedback type', 'Thumbs down'] : ['Feedback type', 'Thumbs UP'], ['Type', type], ['Pageid', pageid && `[${pageid}](https://aisafety.info/questions/${pageid}/${question})`], ['Selected option', option], @@ -42,7 +43,6 @@ export const action = async ({request}: ActionFunctionArgs) => { .map(([item, val]) => `* ${item} - ${val}`) .join('\n') formData.append('payload_json', JSON.stringify({content: `Chat feedback:\n${info}`})) - const DISCORD_LOGGING_URL = `https://discord.com/api/webhooks/${DISCORD_LOGGING_CHANNEL_ID}/${DISCORD_LOGGING_TOKEN}` const response = await fetch(`${DISCORD_LOGGING_URL}`, {method: 'POST', body: formData}) if (!response.ok) {