From 047767bab0b8b457115515d912c634fcb25d95d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Tue, 14 Sep 2021 17:38:34 +0200 Subject: [PATCH] Improve typing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/components/views/dialogs/FeedbackDialog.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/views/dialogs/FeedbackDialog.tsx b/src/components/views/dialogs/FeedbackDialog.tsx index 6f957452bc..e7089283e4 100644 --- a/src/components/views/dialogs/FeedbackDialog.tsx +++ b/src/components/views/dialogs/FeedbackDialog.tsx @@ -34,7 +34,7 @@ const newIssueUrl = "https://github.com/vector-im/element-web/issues/new/choose" interface IProps extends IDialogProps {} const FeedbackDialog: React.FC = (props: IProps) => { - const [rating, setRating] = useState(); + const [rating, setRating] = useState(); const [comment, setComment] = useState(""); const onDebugLogsLinkClick = (): void => { @@ -45,7 +45,7 @@ const FeedbackDialog: React.FC = (props: IProps) => { const hasFeedback = CountlyAnalytics.instance.canEnable(); const onFinished = (sendFeedback: boolean): void => { if (hasFeedback && sendFeedback) { - CountlyAnalytics.instance.reportFeedback((parseInt(rating) as Rating), comment); + CountlyAnalytics.instance.reportFeedback(rating, comment); Modal.createTrackedDialog('Feedback sent', '', InfoDialog, { title: _t('Feedback sent'), description: _t('Thank you!'), @@ -68,8 +68,8 @@ const FeedbackDialog: React.FC = (props: IProps) => { setRating(parseInt(r, 10) as Rating)} definitions={[ { value: "1", label: "😠" }, { value: "2", label: "😞" }, @@ -141,7 +141,7 @@ const FeedbackDialog: React.FC = (props: IProps) => { { countlyFeedbackSection } } button={hasFeedback ? _t("Send feedback") : _t("Go back")} - buttonDisabled={hasFeedback && rating === ""} + buttonDisabled={hasFeedback && !rating} onFinished={onFinished} />); };