summaryrefslogtreecommitdiff
path: root/web/source/settings/user/profile.js
diff options
context:
space:
mode:
authorLibravatar f0x52 <f0x@cthu.lu>2023-02-06 09:19:56 +0100
committerLibravatar GitHub <noreply@github.com>2023-02-06 09:19:56 +0100
commit47daddc10c291ec67320dd2485bffc498ea44bdf (patch)
tree530677541399c27cd292dfc0050a71273c35f098 /web/source/settings/user/profile.js
parent[chore]: Bump codeberg.org/gruf/go-runners from 1.4.0 to 1.5.1 (#1428) (diff)
downloadgotosocial-47daddc10c291ec67320dd2485bffc498ea44bdf.tar.xz
[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
Diffstat (limited to 'web/source/settings/user/profile.js')
-rw-r--r--web/source/settings/user/profile.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/web/source/settings/user/profile.js b/web/source/settings/user/profile.js
index 76f416dd1..b2d2d25b3 100644
--- a/web/source/settings/user/profile.js
+++ b/web/source/settings/user/profile.js
@@ -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());