mirror of
https://github.com/superseriousbusiness/gotosocial
synced 2025-06-05 21:59:39 +02:00
[chore/frogend] Restructure form data default values / update from Query data (#1422)
* eslint: set console use to error to catch debug littering in CI * remove debug logging * some form field restructuring, fixes submitted updates not being reflected * more form field restructuring * remove debug logger * simplify field updates * fix react state set during render when submitting import file * className instead of class * show Select hints again
This commit is contained in:
@ -71,12 +71,12 @@ function UserProfileForm({ data: profile }) {
|
||||
const form = {
|
||||
avatar: useFileInput("avatar", { withPreview: true }),
|
||||
header: useFileInput("header", { withPreview: true }),
|
||||
displayName: useTextInput("display_name", { defaultValue: profile.display_name }),
|
||||
note: useTextInput("note", { defaultValue: profile.source?.note }),
|
||||
customCSS: useTextInput("custom_css", { defaultValue: profile.custom_css }),
|
||||
bot: useBoolInput("bot", { defaultValue: profile.bot }),
|
||||
locked: useBoolInput("locked", { defaultValue: profile.locked }),
|
||||
enableRSS: useBoolInput("enable_rss", { defaultValue: profile.enable_rss }),
|
||||
displayName: useTextInput("display_name", { source: profile }),
|
||||
note: useTextInput("note", { source: profile, valueSelector: (p) => p.source?.note }),
|
||||
customCSS: useTextInput("custom_css", { source: profile }),
|
||||
bot: useBoolInput("bot", { source: profile }),
|
||||
locked: useBoolInput("locked", { source: profile }),
|
||||
enableRSS: useBoolInput("enable_rss", { source: profile }),
|
||||
};
|
||||
|
||||
const [submitForm, result] = useFormSubmit(form, query.useUpdateCredentialsMutation());
|
||||
|
Reference in New Issue
Block a user