From 05a9023bac835b8ca114a78c1eeef0739cc55057 Mon Sep 17 00:00:00 2001 From: Michael Telatynski <7t3chguy@gmail.com> Date: Fri, 23 Jul 2021 18:31:31 +0100 Subject: [PATCH] delint and tidy code --- .../views/dialogs/BetaFeedbackDialog.tsx | 9 ++---- .../views/spaces/SpaceCreateMenu.tsx | 30 +++++++++++-------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/components/views/dialogs/BetaFeedbackDialog.tsx b/src/components/views/dialogs/BetaFeedbackDialog.tsx index 788832119f..98b228082a 100644 --- a/src/components/views/dialogs/BetaFeedbackDialog.tsx +++ b/src/components/views/dialogs/BetaFeedbackDialog.tsx @@ -34,17 +34,14 @@ interface IProps extends IDialogProps { const BetaFeedbackDialog: React.FC = ({ featureId, onFinished }) => { const info = SettingsStore.getBetaInfo(featureId); - const extraData = SettingsStore.getBetaInfo(featureId)?.extraSettings.reduce((o, k) => { - o[k] = SettingsStore.getValue(k); - return o; - }, {}); - return { + return SettingsStore.getValue(k); + }))} > { onFinished(false); diff --git a/src/components/views/spaces/SpaceCreateMenu.tsx b/src/components/views/spaces/SpaceCreateMenu.tsx index 279ae1165b..ee01984db0 100644 --- a/src/components/views/spaces/SpaceCreateMenu.tsx +++ b/src/components/views/spaces/SpaceCreateMenu.tsx @@ -73,19 +73,23 @@ const SpaceFeedbackPrompt = ({ onClick }: { onClick?: () => void }) => {
{ _t("Spaces are a new feature.") } - { - if (onClick) onClick(); - Modal.createTrackedDialog("Spaces Feedback", "", GenericFeatureFeedbackDialog, { - title: _t("Spaces feedback"), - subheading: _t("Thank you for trying Spaces. Your feedback will help inform the next versions."), - rageshakeLabel: "spaces-feedback", - rageshakeData: { - "feature_spaces.all_rooms": SettingsStore.getValue("feature_spaces.all_rooms"), - "feature_spaces.space_member_dms": SettingsStore.getValue("feature_spaces.space_member_dms"), - "feature_spaces.space_dm_badges": SettingsStore.getValue("feature_spaces.space_dm_badges"), - }, - }); - }}> + { + if (onClick) onClick(); + Modal.createTrackedDialog("Spaces Feedback", "", GenericFeatureFeedbackDialog, { + title: _t("Spaces feedback"), + subheading: _t("Thank you for trying Spaces. " + + "Your feedback will help inform the next versions."), + rageshakeLabel: "spaces-feedback", + rageshakeData: Object.fromEntries([ + "feature_spaces.all_rooms", + "feature_spaces.space_member_dms", + "feature_spaces.space_dm_badges", + ].map(k => [k, SettingsStore.getValue(k)])), + }); + }} + > { _t("Give feedback.") }