aboutsummaryrefslogtreecommitdiffhomepage
path: root/frontend/src/components
diff options
context:
space:
mode:
authorLASER-Yi <[email protected]>2022-10-28 21:38:11 +0800
committerLASER-Yi <[email protected]>2022-10-28 21:38:11 +0800
commitaee1849ce3653320aef139500e84fe6643cbbcbc (patch)
tree55dd18fb725e4c0ff2080c8f576e7b1d29dc0395 /frontend/src/components
parent122398fdc869c1c9bb3aa092f6997db85da26925 (diff)
downloadbazarr-aee1849ce3653320aef139500e84fe6643cbbcbc.tar.gz
bazarr-aee1849ce3653320aef139500e84fe6643cbbcbc.zip
Update node packages, fix issuesv1.1.3-beta.9
Diffstat (limited to 'frontend/src/components')
-rw-r--r--frontend/src/components/forms/MovieUploadForm.tsx7
-rw-r--r--frontend/src/components/forms/ProfileEditForm.tsx2
-rw-r--r--frontend/src/components/forms/SeriesUploadForm.tsx6
3 files changed, 8 insertions, 7 deletions
diff --git a/frontend/src/components/forms/MovieUploadForm.tsx b/frontend/src/components/forms/MovieUploadForm.tsx
index e1232afc3..4506baa83 100644
--- a/frontend/src/components/forms/MovieUploadForm.tsx
+++ b/frontend/src/components/forms/MovieUploadForm.tsx
@@ -134,12 +134,13 @@ const MovieUploadForm: FunctionComponent<Props> = ({
}, [form.values.files.length, modals]);
const action = useArrayAction<SubtitleFile>((fn) => {
- form.setValues(({ files, ...rest }) => {
- const newFiles = fn(files);
+ form.setValues((values) => {
+ const newFiles = fn(values.files ?? []);
newFiles.forEach((v) => {
v.validateResult = validator(movie, v);
});
- return { ...rest, files: newFiles };
+
+ return { ...values, files: newFiles };
});
});
diff --git a/frontend/src/components/forms/ProfileEditForm.tsx b/frontend/src/components/forms/ProfileEditForm.tsx
index 9a58a9f36..50074cbc7 100644
--- a/frontend/src/components/forms/ProfileEditForm.tsx
+++ b/frontend/src/components/forms/ProfileEditForm.tsx
@@ -95,7 +95,7 @@ const ProfileEditForm: FunctionComponent<Props> = ({
);
const action = useArrayAction<Language.ProfileItem>((fn) => {
- form.setValues((values) => ({ ...values, items: fn(values.items) }));
+ form.setValues((values) => ({ ...values, items: fn(values.items ?? []) }));
});
const addItem = useCallback(() => {
diff --git a/frontend/src/components/forms/SeriesUploadForm.tsx b/frontend/src/components/forms/SeriesUploadForm.tsx
index e7363d15e..3c8b036a4 100644
--- a/frontend/src/components/forms/SeriesUploadForm.tsx
+++ b/frontend/src/components/forms/SeriesUploadForm.tsx
@@ -142,12 +142,12 @@ const SeriesUploadForm: FunctionComponent<Props> = ({
});
const action = useArrayAction<SubtitleFile>((fn) => {
- form.setValues(({ files, ...rest }) => {
- const newFiles = fn(files);
+ form.setValues((values) => {
+ const newFiles = fn(values.files ?? []);
newFiles.forEach((v) => {
v.validateResult = validator(v);
});
- return { ...rest, files: newFiles };
+ return { ...values, files: newFiles };
});
});