fixed data fetching error

This commit is contained in:
Russel Yasol
2024-10-03 14:02:10 +08:00
parent a9f8ae753b
commit 148fb5df1b

View File

@@ -388,8 +388,6 @@ function processBandwidth(response, networkType) {
processNR5GBandwidth(sccLines, pccBWParsed);
} else if (networkType === "LTE") {
processLTEBandwidth(sccLines, pccBWParsed);
} else {
setText("allBW", "Unknown");
}
}
@@ -401,25 +399,7 @@ function extractSCCData(response) {
}
function processNR5GBandwidth(sccLines, pccBWParsed) {
const networkType = determineNetworkType(jsonData[10].response);
if (networkType === "NR5G-SA") {
const nrBW = sccLines.slice(0, sccLines.length - 1).map((line) => {
const bw = line.split(":")[1].split(",")[2].trim();
return NR_BANDWIDTH_MAP[bw] || "Unknown";
});
if (nrBW.length === 0) {
setText("allBW", `${pccBWParsed}`);
return;
}
setText("allBW", `${pccBWParsed} + ${nrBW.join(" / ")}`);
} else {
const nrBW = sccLines[sccLines.length - 1]
.split(":")[1]
.split(",")[2]
.trim();
const nrBW = sccLines[sccLines.length - 1].split(":")[1].split(",")[2].trim();
const nrBWParsed = NR_BANDWIDTH_MAP[nrBW] || "Unknown";
const lteBW = sccLines.slice(0, sccLines.length - 1).map((line) => {
@@ -431,8 +411,7 @@ function processNR5GBandwidth(sccLines, pccBWParsed) {
setText("allBW", `${pccBWParsed} + NR${nrBWParsed}`);
return;
}
setText("allBW", `${pccBWParsed} + ${lteBW.join(" / ")} + NR${nrBWParsed}`);
}
setText("allBW", `${pccBWParsed} + ${lteBW.join(" + ")} + NR${nrBWParsed}`);
}
function processLTEBandwidth(sccLines, pccBWParsed) {