Skip to content

Commit 2630bcb

Browse files
committed
Refactor imports and update profile selector
1 parent 98bccad commit 2630bcb

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llmstack/client/src/pages/setting.jsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ import { styled } from "@mui/material/styles";
1818
import validator from "@rjsf/validator-ajv8";
1919
import { enqueueSnackbar } from "notistack";
2020
import { createRef, useEffect, useState } from "react";
21-
import { useRecoilValue, useRecoilState } from "recoil";
21+
import { useRecoilValue } from "recoil";
2222
import Connections from "../components/Connections";
2323
import Subscription from "../components/Subscription";
2424
import ThemedJsonForm from "../components/ThemedJsonForm";
25-
import { profileFlagsState, profileState } from "../data/atoms";
25+
import { profileFlagsState, profileSelector } from "../data/atoms";
2626
import { axios } from "../data/axios";
2727
import "../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

Comments
 (0)