fix: Avoid empty user-agent

This commit is contained in:
MystiPanda
2024-03-15 18:27:24 +08:00
Unverified
parent 0e1e27b35a
commit ea5fad428d

View File

@@ -51,7 +51,6 @@ export const ProfileViewer = forwardRef<ProfileViewerRef, Props>(
desc: "",
url: "",
option: {
// user_agent: "",
with_proxy: false,
self_proxy: false,
},
@@ -99,6 +98,9 @@ export const ProfileViewer = forwardRef<ProfileViewerRef, Props>(
if (form.option?.update_interval) {
form.option.update_interval = +form.option.update_interval;
}
if (form.option?.user_agent === "") {
delete form.option.user_agent;
}
const name = form.name || `${form.type} file`;
const item = { ...form, name };