From 41338699574f581dc23ff68c238277d25e45832d Mon Sep 17 00:00:00 2001 From: Liam Fitzgerald Date: Fri, 12 Mar 2021 15:02:49 +1000 Subject: [PATCH] notifications: add submit button for preferences Fixes urbit/landscape#535 --- .../settings/components/lib/NotificationPref.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pkg/interface/src/views/apps/settings/components/lib/NotificationPref.tsx b/pkg/interface/src/views/apps/settings/components/lib/NotificationPref.tsx index 2c47eccc8..c673f326a 100644 --- a/pkg/interface/src/views/apps/settings/components/lib/NotificationPref.tsx +++ b/pkg/interface/src/views/apps/settings/components/lib/NotificationPref.tsx @@ -4,12 +4,12 @@ import { Text, ManagedToggleSwitchField as Toggle, } from "@tlon/indigo-react"; -import { Form, FormikHelpers } from "formik"; -import { FormikOnBlur } from "~/views/components/FormikOnBlur"; +import { Formik, Form, FormikHelpers } from "formik"; import { BackButton } from "./BackButton"; import GlobalApi from "~/logic/api/global"; import useHarkState from "~/logic/state/hark"; import _ from "lodash"; +import {AsyncButton} from "~/views/components/AsyncButton"; interface FormSchema { mentions: boolean; @@ -44,12 +44,11 @@ export function NotificationPreferences(props: { await Promise.all(promises); actions.setStatus({ success: null }); - actions.resetForm({ values: initialValues }); } catch (e) { console.error(e); actions.setStatus({ error: e.message }); } - }, [api]); + }, [api, graphConfig, dnd]); return ( <> @@ -64,7 +63,7 @@ export function NotificationPreferences(props: { messaging - +
+ + Save + -
+ );