fix: patch item option

This commit is contained in:
GyDi 2022-03-11 19:56:56 +08:00
parent cf00c9476f
commit 8890051c17
No known key found for this signature in database
GPG Key ID: 58B15242BA8277A6
2 changed files with 2 additions and 2 deletions

View File

@ -41,7 +41,7 @@ const ProfileEdit = (props: Props) => {
try {
const { uid } = itemData;
const { name, desc, url } = form;
const option_ = showOpt ? option : undefined;
const option_ = itemData.type === "remote" ? option : undefined;
if (itemData.type === "remote" && !url) {
throw new Error("Remote URL should not be null");

View File

@ -54,7 +54,7 @@ const ProfileNew = (props: Props) => {
throw new Error("The URL should not be null");
}
const option_ = showOpt ? option : undefined;
const option_ = form.type === "remote" ? option : undefined;
await createProfile({ ...form, name, option: option_ });
setForm({ type: "remote", name: "", desc: "", url: "" });
setOption({ user_agent: "" });