mirror of
https://github.com/hydralauncher/hydra.git
synced 2025-01-23 13:34:54 +03:00
feat: update user details on settings account tab
This commit is contained in:
parent
af4fcb8f06
commit
c4378c0ffc
@ -33,7 +33,8 @@ export class DatanodesApi {
|
|||||||
"User-Agent":
|
"User-Agent":
|
||||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36",
|
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36",
|
||||||
},
|
},
|
||||||
maxRedirects: 0, validateStatus: (status: number) => status === 302 || status < 400,
|
maxRedirects: 0,
|
||||||
|
validateStatus: (status: number) => status === 302 || status < 400,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Button, SelectField } from "@renderer/components";
|
import { Button, SelectField } from "@renderer/components";
|
||||||
import { SPACING_UNIT, vars } from "@renderer/theme.css";
|
import { SPACING_UNIT } from "@renderer/theme.css";
|
||||||
import { Controller, useForm } from "react-hook-form";
|
import { Controller, useForm } from "react-hook-form";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
@ -36,9 +36,13 @@ export function SettingsAccount() {
|
|||||||
handleSubmit,
|
handleSubmit,
|
||||||
} = useForm<FormValues>();
|
} = useForm<FormValues>();
|
||||||
|
|
||||||
const { patchUser, userDetails } = useUserDetails();
|
const {
|
||||||
|
userDetails,
|
||||||
const { unblockUser } = useUserDetails();
|
patchUser,
|
||||||
|
fetchUserDetails,
|
||||||
|
updateUserDetails,
|
||||||
|
unblockUser,
|
||||||
|
} = useUserDetails();
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (userDetails?.profileVisibility) {
|
if (userDetails?.profileVisibility) {
|
||||||
@ -46,6 +50,14 @@ export function SettingsAccount() {
|
|||||||
}
|
}
|
||||||
}, [userDetails, setValue]);
|
}, [userDetails, setValue]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
fetchUserDetails().then((response) => {
|
||||||
|
if (response) {
|
||||||
|
updateUserDetails(response);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}, []);
|
||||||
|
|
||||||
const visibilityOptions = [
|
const visibilityOptions = [
|
||||||
{ value: "PUBLIC", label: t("public") },
|
{ value: "PUBLIC", label: t("public") },
|
||||||
{ value: "FRIENDS", label: t("friends_only") },
|
{ value: "FRIENDS", label: t("friends_only") },
|
||||||
|
Loading…
Reference in New Issue
Block a user