B: Fix substitution editor
Some checks are pending
Frontend CI / build (22.x) (push) Waiting to run

This commit is contained in:
Ivan 2024-08-19 12:33:04 +03:00
parent 2470fe1fae
commit 3d80947af5

View File

@ -67,8 +67,8 @@ function DlgEditOperation({ hideWindow, oss, target, onSubmit }: DlgEditOperatio
if (cache.loading || schemas.length !== schemasIDs.length) { if (cache.loading || schemas.length !== schemasIDs.length) {
return; return;
} }
setSubstitutions(() => setSubstitutions(prev =>
target.substitutions.filter(sub => { prev.filter(sub => {
const original = cache.getSchemaByCst(sub.original); const original = cache.getSchemaByCst(sub.original);
if (!original || !schemasIDs.includes(original.id)) { if (!original || !schemasIDs.includes(original.id)) {
return false; return false;
@ -80,7 +80,7 @@ function DlgEditOperation({ hideWindow, oss, target, onSubmit }: DlgEditOperatio
return true; return true;
}) })
); );
}, [schemasIDs, schemas, cache.loading, target.substitutions]); }, [schemasIDs, schemas, cache.loading]);
const handleSubmit = () => { const handleSubmit = () => {
const data: IOperationUpdateData = { const data: IOperationUpdateData = {