apply suggestions
continuous-integration/drone/push Build is passing Details

pull/23/head
Override-6 1 year ago
parent cb24dd53a9
commit 6ebf3737af
Signed by untrusted user who does not match committer: maxime.batista
GPG Key ID: 8002CC4B4DD9ECA5

@ -24,8 +24,8 @@ export default function CourtPlayer({
}: PlayerProps) { }: PlayerProps) {
const pieceRef = useRef<HTMLDivElement>(null) const pieceRef = useRef<HTMLDivElement>(null)
const [x, setX] = useState(player.rightRatio) const x = player.rightRatio
const [y, setY] = useState(player.bottomRatio) const y = player.bottomRatio
return ( return (
<Draggable <Draggable
@ -39,9 +39,6 @@ export default function CourtPlayer({
const { x, y } = calculateRatio(pieceBounds, parentBounds) const { x, y } = calculateRatio(pieceBounds, parentBounds)
setX(x)
setY(y)
onChange({ onChange({
rightRatio: x, rightRatio: x,
bottomRatio: y, bottomRatio: y,

@ -132,7 +132,7 @@ function EditorView({
default_value={name} default_value={name}
on_validated={(new_name) => { on_validated={(new_name) => {
onNameChange(new_name).then((success) => { onNameChange(new_name).then((success) => {
success ? setStyle({}) : setStyle(ERROR_STYLE) setStyle(success ? {} : ERROR_STYLE)
}) })
}} }}
/> />
@ -239,7 +239,7 @@ function useContentState<S>(
} }
return state return state
}) })
}, []) }, [saveStateCallback])
return [content, setContentSynced, savingState] return [content, setContentSynced, savingState]
} }

@ -57,7 +57,7 @@ class APITacticController {
"content" => [], "content" => [],
], function (HttpRequest $req) use ($id) { ], function (HttpRequest $req) use ($id) {
if ($fail = $this->model->updateContent($id, json_encode($req["content"]))) { if ($fail = $this->model->updateContent($id, json_encode($req["content"]))) {
return new JsonHttpResponse([$fail]); return new JsonHttpResponse([$fail], HttpCodes::BAD_REQUEST);
} }
return HttpResponse::fromCode(HttpCodes::OK); return HttpResponse::fromCode(HttpCodes::OK);
}); });

Loading…
Cancel
Save