Explorar o código

required={!hasChannel}

visuddhinanda %!s(int64=2) %!d(string=hai) anos
pai
achega
4f54fef73b
Modificáronse 1 ficheiros con 6 adicións e 9 borrados
  1. 6 9
      dashboard/src/components/term/TermEdit.tsx

+ 6 - 9
dashboard/src/components/term/TermEdit.tsx

@@ -298,6 +298,11 @@ const TermEditWidget = ({
         />
         <ProFormDependency name={["channel"]}>
           {({ channel }) => {
+            const hasChannel = channel
+              ? channel.length === 0 || channel[0] === ""
+                ? false
+                : true
+              : false;
             let noChange = true;
             if (!channel || channel.length === 0 || channel[0] === "") {
               if (!channelId || channelId === null || channelId === "") {
@@ -314,15 +319,7 @@ const TermEditWidget = ({
             }
             return (
               <Space>
-                <LangSelect
-                  disabled={
-                    channel
-                      ? channel.length === 0 || channel[0] === ""
-                        ? false
-                        : true
-                      : false
-                  }
-                />
+                <LangSelect disabled={hasChannel} required={!hasChannel} />
                 <ProFormSelect
                   initialValue={"move"}
                   name="copy"