Fix hethans state issue

This commit is contained in:
zkldi
2021-12-12 01:52:06 +00:00
parent 5bec211e0e
commit fc4a9184bf
2 changed files with 6 additions and 3 deletions
@@ -182,13 +182,13 @@ function PreferencesForm({ reqUser, game, playtype }: Props) {
}
function ShowcaseForm({ reqUser, game, playtype }: Props) {
const { settings } = useContext(UGPTSettingsContext);
const { settings, setSettings } = useContext(UGPTSettingsContext);
const [stats, setStats] = useState(settings!.preferences.stats);
const [show, setShow] = useState(false);
const SaveChanges = async () => {
await APIFetchV1(
const r = await APIFetchV1<UGPTSettings>(
`/users/${reqUser.id}/games/${game}/${playtype}/showcase`,
{
method: "PUT",
@@ -198,6 +198,10 @@ function ShowcaseForm({ reqUser, game, playtype }: Props) {
true,
true
);
if (r.success) {
setSettings(r.body);
}
};
const [isFirstPaint, setIsFirstPaint] = useState(true);
@@ -1,4 +1,3 @@
import { TachiConfig } from "lib/config";
import React from "react";
import CenterLayoutPage from "../layout/CenterLayoutPage";
import DebugContent from "./DebugContent";