Skip to content

Commit

Permalink
Fix default alias state when changing performer name (#690)
Browse files Browse the repository at this point in the history
  • Loading branch information
InfiniteStash authored Jul 16, 2023
1 parent 05ea352 commit 5bc784c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions frontend/src/pages/performers/performerForm/PerformerForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@ const PerformerForm: FC<PerformerProps> = ({
});

const [activeTab, setActiveTab] = useState("personal");
const [updateAliases, setUpdateAliases] = useState<boolean>();
const [updateAliases, setUpdateAliases] = useState<boolean>(
options?.set_modify_aliases ?? true
);
const [file, setFile] = useState<File | undefined>();

const fieldData = watch();
Expand Down Expand Up @@ -262,7 +264,7 @@ const PerformerForm: FC<PerformerProps> = ({
)
performerData.breast_type = BreastTypeEnum.NA;

callback(performerData, data.note, updateAliases ?? false, data.id);
callback(performerData, data.note, updateAliases, data.id);
};

const countryObj = [
Expand Down Expand Up @@ -340,8 +342,7 @@ const PerformerForm: FC<PerformerProps> = ({
<Form.Check
id="update-modify-aliases"
checked={updateAliases}
defaultChecked={options?.set_modify_aliases ?? false}
onChange={() => setUpdateAliases(!updateAliases)}
onChange={() => setUpdateAliases((prev) => !prev)}
label="Set unset performance aliases to old name"
className="d-inline-block"
/>
Expand Down

0 comments on commit 5bc784c

Please sign in to comment.