浏览代码

avoid divide by zero/NaN in signal/noise ratio

tags/v1.0.6
Jonathan Cobb 4 年前
父节点
当前提交
8ca791e6b8
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. +1
    -1
      bubble-server/src/main/resources/bubble/rule/social/block/JsUserBlockerRuleDriver.js.hbs

+ 1
- 1
bubble-server/src/main/resources/bubble/rule/social/block/JsUserBlockerRuleDriver.js.hbs 查看文件

@@ -474,7 +474,7 @@ function {{JS_PREFIX}}_show_app_details() {
const summaryLabel = {{PAGE_PREFIX}}_msg_or_default({{JS_PREFIX}}_messages, 'web_signalNoiseRatio', 'signal/noise');
const totalAllowed = {{PAGE_PREFIX}}_allow_tally;
const fullTotal = totalAllowed + totalBlocks;
const ratio = 100.0 * (totalAllowed / fullTotal);
const ratio = fullTotal === 0 ? 0 : 100.0 * (totalAllowed / fullTotal);
const eqSign = totalBlocks === 0 ? '=' : '≈';
summaryHeader.appendChild(document.createTextNode(summaryLabel + ': ' + totalAllowed + '/' + totalBlocks + ' '+eqSign+' ' + ratio.toLocaleString('{{ACCOUNT_LOCALE_HYPHEN}}', { maximumSignificantDigits: 3 }) + '%'));
recentBlocksDiv.appendChild(summaryHeader);


正在加载...
取消
保存