mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-08-23 11:36:19 -05:00
change setting backend bug fix
This commit is contained in:
24
react-ui/src/components/user/Settings.js
vendored
24
react-ui/src/components/user/Settings.js
vendored
@@ -52,7 +52,7 @@ const Settings = ({ user, closeSettings, handleSuccess, handleError }) => {
|
||||
],
|
||||
})
|
||||
|
||||
const handleProfileUpdate = async e => {
|
||||
const handleSubmit = async () => {
|
||||
const newProfile = { ...forms }
|
||||
if (newProfile.country === "") newProfile.country = null
|
||||
if (newProfile.stick_sens === "") newProfile.stick_sens = null
|
||||
@@ -79,7 +79,7 @@ const Settings = ({ user, closeSettings, handleSuccess, handleError }) => {
|
||||
<Header size="small">Profile picture</Header>
|
||||
To add a profile picture you need to verify your Twitter on Discord and
|
||||
log back in to sendou.ink
|
||||
<Form style={{ marginTop: "2em" }}>
|
||||
<Form style={{ marginTop: "2em" }} onSubmit={handleSubmit}>
|
||||
<Form.Field>
|
||||
<label>Country</label>
|
||||
<CountryDropdown
|
||||
@@ -127,17 +127,17 @@ const Settings = ({ user, closeSettings, handleSuccess, handleError }) => {
|
||||
multiple
|
||||
/>
|
||||
</Form.Field>
|
||||
</Form>
|
||||
<div style={{ marginTop: "1.5em" }}>
|
||||
<Button onClick={() => handleProfileUpdate()} disabled={submitDisabled}>
|
||||
Save
|
||||
</Button>
|
||||
<span style={{ marginLeft: "0.3em" }}>
|
||||
<Button negative onClick={closeSettings}>
|
||||
Cancel
|
||||
<Form.Field>
|
||||
<Button type="submit" disabled={submitDisabled}>
|
||||
Save
|
||||
</Button>
|
||||
</span>
|
||||
</div>
|
||||
<span style={{ marginLeft: "0.3em" }}>
|
||||
<Button negative onClick={closeSettings}>
|
||||
Cancel
|
||||
</Button>
|
||||
</span>
|
||||
</Form.Field>
|
||||
</Form>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
1
react-ui/src/components/user/UserPage.js
vendored
1
react-ui/src/components/user/UserPage.js
vendored
@@ -88,7 +88,6 @@ const UserPage = () => {
|
||||
setTab(activeIndex)
|
||||
}
|
||||
|
||||
console.log("imageError", imageError)
|
||||
return (
|
||||
<>
|
||||
<>
|
||||
|
||||
@@ -110,7 +110,7 @@ const resolvers = {
|
||||
})
|
||||
}
|
||||
|
||||
if (args.stick_sens) {
|
||||
if (args.stick_sens !== null) {
|
||||
const number = Math.floor(args.stick_sens * 10)
|
||||
if (number < -50 || number > 50 || number % 5 != 0) {
|
||||
throw new UserInputError("Invalid motion sensitivity", {
|
||||
@@ -123,7 +123,7 @@ const resolvers = {
|
||||
delete args.stick_sens
|
||||
}
|
||||
|
||||
if (args.motion_sens) {
|
||||
if (args.motion_sens !== null) {
|
||||
const number = Math.floor(args.motion_sens * 10)
|
||||
if (number < -50 || number > 50 || number % 5 != 0) {
|
||||
throw new UserInputError("Invalid motion sensitivity", {
|
||||
|
||||
Reference in New Issue
Block a user