@@ -18,11 +18,11 @@ import { styled } from "@mui/material/styles";
1818import validator from "@rjsf/validator-ajv8" ;
1919import { enqueueSnackbar } from "notistack" ;
2020import { createRef , useEffect , useState } from "react" ;
21- import { useRecoilValue , useRecoilState } from "recoil" ;
21+ import { useRecoilValue } from "recoil" ;
2222import Connections from "../components/Connections" ;
2323import Subscription from "../components/Subscription" ;
2424import ThemedJsonForm from "../components/ThemedJsonForm" ;
25- import { profileFlagsState , profileState } from "../data/atoms" ;
25+ import { profileFlagsState , profileSelector } from "../data/atoms" ;
2626import { axios } from "../data/axios" ;
2727import "../index.css" ;
2828
@@ -149,7 +149,7 @@ const SettingPage = () => {
149149 const [ loading , setLoading ] = useState ( false ) ;
150150 const [ updateKeys , setUpdateKeys ] = useState ( new Set ( ) ) ;
151151 const profileFlags = useRecoilValue ( profileFlagsState ) ;
152- const [ profileData , setProfileData ] = useRecoilState ( profileState ) ;
152+ const profileData = useRecoilValue ( profileSelector ) ;
153153 const formRef = createRef ( ) ;
154154
155155 useEffect ( ( ) => {
@@ -166,7 +166,6 @@ const SettingPage = () => {
166166 axios ( )
167167 . patch ( "api/profiles/me" , data )
168168 . then ( ( response ) => {
169- setProfileData ( response . data ) ;
170169 enqueueSnackbar ( "Profile updated successfully" , {
171170 variant : "success" ,
172171 } ) ;
@@ -182,6 +181,7 @@ const SettingPage = () => {
182181 . finally ( ( ) => {
183182 setUpdateKeys ( new Set ( ) ) ;
184183 setLoading ( false ) ;
184+ window . location . reload ( ) ;
185185 } ) ;
186186 } ;
187187
0 commit comments