diff --git a/apps/web/pages/settings/my-account/appearance.tsx b/apps/web/pages/settings/my-account/appearance.tsx
index 5642b61c00..9da3eed0b2 100644
--- a/apps/web/pages/settings/my-account/appearance.tsx
+++ b/apps/web/pages/settings/my-account/appearance.tsx
@@ -41,9 +41,25 @@ const SkeletonLoader = () => {
const AppearanceView = () => {
const { t } = useLocale();
+ const utils = trpc.useContext();
const { data: user, isLoading } = trpc.viewer.me.useQuery();
+
+ const formMethods = useForm({
+ defaultValues: {
+ theme: user?.theme,
+ brandColor: user?.brandColor || "#292929",
+ darkBrandColor: user?.darkBrandColor || "#fafafa",
+ hideBranding: user?.hideBranding,
+ },
+ });
+
+ const {
+ formState: { isSubmitting, isDirty },
+ } = formMethods;
+
const mutation = trpc.viewer.updateProfile.useMutation({
- onSuccess: () => {
+ onSuccess: async () => {
+ await utils.viewer.me.invalidate();
showToast(t("settings_updated_successfully"), "success");
},
onError: () => {
@@ -51,129 +67,138 @@ const AppearanceView = () => {
},
});
- const formMethods = useForm();
-
if (isLoading) return