diff --git a/src/settings/FeedbackSettingsTab.tsx b/src/settings/FeedbackSettingsTab.tsx index f47d10ac2..afefe07eb 100644 --- a/src/settings/FeedbackSettingsTab.tsx +++ b/src/settings/FeedbackSettingsTab.tsx @@ -69,9 +69,7 @@ export const FeedbackSettingsTab: FC = ({ roomId }) => { disabled={sending || sent} /> - {sent ? ( - {t("settings.feedback_tab_thank_you")} - ) : ( + {!sent && ( = ({ roomId }) => { type="checkbox" defaultChecked /> - {error && ( - - - - )} )} + + {error && } + {sent && {t("settings.feedback_tab_thank_you")}} + ); diff --git a/src/settings/submit-rageshake.ts b/src/settings/submit-rageshake.ts index 16b81d0b6..1ab906672 100644 --- a/src/settings/submit-rageshake.ts +++ b/src/settings/submit-rageshake.ts @@ -270,11 +270,17 @@ export function useSubmitRageshake(): { ); } - await fetch(Config.get().rageshake!.submit_url, { + const res = await fetch(Config.get().rageshake!.submit_url, { method: "POST", body, }); + if (res.status !== 200) { + throw new Error( + `Failed to submit feedback: receive HTTP ${res.status} ${res.statusText}`, + ); + } + setState({ sending: false, sent: true, error: undefined }); } catch (error) { setState({ sending: false, sent: false, error: error as Error });