Просмотр исходного кода

fix(rule): fix rule-editor cache

Lind 3 лет назад
Родитель
Сommit
79ba66a977

+ 1 - 3
src/components/FRuleEditor/Editor/index.tsx

@@ -109,6 +109,7 @@ const Editor = (props: Props) => {
         text: value,
       },
     ]);
+    Store.set('add-operator-value', undefined);
   };
 
   useEffect(() => {
@@ -116,9 +117,6 @@ const Editor = (props: Props) => {
     return () => subscription.unsubscribe();
   }, [props.mode]);
 
-  useEffect(() => {
-    Store.set('add-operator-value', undefined);
-  }, []);
   return (
     <div className={styles.box}>
       <div className={styles.top}>

+ 4 - 1
src/components/FRuleEditor/index.tsx

@@ -31,7 +31,10 @@ const FRuleEditor = observer((props: Props) => {
     State.property = property;
     const subscription = Store.subscribe('rule-editor-value', onChange);
     State.code = value;
-    return () => subscription.unsubscribe();
+    return () => {
+      subscription.unsubscribe();
+      State.code = '';
+    };
   });
   return (
     <>

+ 0 - 1
src/pages/link/Type/Save/index.tsx

@@ -225,7 +225,6 @@ const Save = observer(() => {
           gridSpan: 1,
           labelAlign: 'left',
           layout: 'vertical',
-          tooltip: '绑定到服务器上的网卡地址,绑定到所有网卡:0.0.0.0 /',
         },
         'x-reactions': [
           {