change single char variables to properly named ones

This commit is contained in:
Robonau 2024-11-11 22:05:17 +00:00 committed by shamoon
parent a18ea0831f
commit c6e01f4334
2 changed files with 6 additions and 6 deletions

View File

@ -11,12 +11,12 @@ import useWidgetAPI from "utils/proxy/use-widget-api";
function makeFields(Fields = []) {
let fields = Fields ?? [];
if (fields.length === 0) {
fields = ["download", "nondownload", "read", "unread"];
fields = ["download", "nonDownload", "read", "unRead"];
}
if (fields.length > 4) {
fields.length = 4;
}
fields = fields.map((f) => f.toLowerCase());
fields = fields.map((field) => field.toLowerCase());
return fields;
}

View File

@ -97,10 +97,10 @@ const countsToExtract = {
function makeBody(fields, category = "all") {
if (Number.isNaN(Number(category))) {
let query = "";
fields.forEach((f) => {
fields.forEach((field) => {
query += `
${f}: chapters(
condition: {${countsToExtract[f].gqlCondition}}
${field}: chapters(
condition: {${countsToExtract[field].gqlCondition}}
filter: {inLibrary: {equalTo: true}}
) {
totalCount
@ -179,7 +179,7 @@ function extractCounts(responseJSON, fields) {
function makeFields(Fields = []) {
let fields = Fields ?? [];
if (fields.length === 0) {
fields = ["download", "nondownload", "read", "unread"];
fields = ["download", "nonDownload", "read", "unRead"];
}
if (fields.length > 4) {
fields.length = 4;