Prechádzať zdrojové kódy

如果symbol == 'ERR' && decimals == 0视为销毁

skyfffire 3 rokov pred
rodič
commit
271f88ebb4
1 zmenil súbory, kde vykonal 9 pridanie a 2 odobranie
  1. 9 2
      scripts/lp/lpMaintenance.ts

+ 9 - 2
scripts/lp/lpMaintenance.ts

@@ -145,8 +145,15 @@ export class LpMaintenance {
 
   updateLocalLpListR0R1(lpList: any, r0s: any, r1s: any) {
     for (let index = 0; index < lpList.length; index++) {
-      lpList[index].dataObj.r0 = r0s[index]
-      lpList[index].dataObj.r1 = r1s[index]
+      const lp = lpList[index].dataObj
+      if ((lp.symbol0 === 'ERR' && parseInt(lp.decimals0) === 0)
+      || (lp.symbol1 === 'ERR' && parseInt(lp.decimals1) === 0)) {
+        lp.r0 = 0
+        lp.r1 = 0
+      } else {
+        lp.r0 = r0s[index]
+        lp.r1 = r1s[index]
+      }
     }
   }