mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-19 21:03:30 -07:00
Switch to new method for checking own properties
The new method is an intended replacement for previous one as suggested by MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/hasOwn
This commit is contained in:
parent
2edb1a0765
commit
6918316a3d
2 changed files with 6 additions and 6 deletions
|
@ -566,7 +566,7 @@ window.addEvent('load', function() {
|
||||||
const torrentsCount = torrentsTable.getRowIds().length;
|
const torrentsCount = torrentsTable.getRowIds().length;
|
||||||
let untagged = 0;
|
let untagged = 0;
|
||||||
for (const key in torrentsTable.rows) {
|
for (const key in torrentsTable.rows) {
|
||||||
if (Object.prototype.hasOwnProperty.call(torrentsTable.rows, key) && (torrentsTable.rows[key]['full_data'].tags.length === 0))
|
if (Object.hasOwn(torrentsTable.rows, key) && (torrentsTable.rows[key]['full_data'].tags.length === 0))
|
||||||
untagged += 1;
|
untagged += 1;
|
||||||
}
|
}
|
||||||
tagFilterList.appendChild(createLink(TAGS_ALL, 'QBT_TR(All)QBT_TR[CONTEXT=TagFilterModel]', torrentsCount));
|
tagFilterList.appendChild(createLink(TAGS_ALL, 'QBT_TR(All)QBT_TR[CONTEXT=TagFilterModel]', torrentsCount));
|
||||||
|
@ -620,7 +620,7 @@ window.addEvent('load', function() {
|
||||||
trackerFilterList.appendChild(createLink(TRACKERS_ALL, 'QBT_TR(All (%1))QBT_TR[CONTEXT=TrackerFiltersList]', torrentsCount));
|
trackerFilterList.appendChild(createLink(TRACKERS_ALL, 'QBT_TR(All (%1))QBT_TR[CONTEXT=TrackerFiltersList]', torrentsCount));
|
||||||
let trackerlessTorrentsCount = 0;
|
let trackerlessTorrentsCount = 0;
|
||||||
for (const key in torrentsTable.rows) {
|
for (const key in torrentsTable.rows) {
|
||||||
if (Object.prototype.hasOwnProperty.call(torrentsTable.rows, key) && (torrentsTable.rows[key]['full_data'].trackers_count === 0))
|
if (Object.hasOwn(torrentsTable.rows, key) && (torrentsTable.rows[key]['full_data'].trackers_count === 0))
|
||||||
trackerlessTorrentsCount += 1;
|
trackerlessTorrentsCount += 1;
|
||||||
}
|
}
|
||||||
trackerFilterList.appendChild(createLink(TRACKERS_TRACKERLESS, 'QBT_TR(Trackerless (%1))QBT_TR[CONTEXT=TrackerFiltersList]', trackerlessTorrentsCount));
|
trackerFilterList.appendChild(createLink(TRACKERS_TRACKERLESS, 'QBT_TR(Trackerless (%1))QBT_TR[CONTEXT=TrackerFiltersList]', trackerlessTorrentsCount));
|
||||||
|
|
|
@ -829,7 +829,7 @@ window.qBittorrent.DynamicTable = (function() {
|
||||||
|
|
||||||
const tds = tr.getElements('td');
|
const tds = tr.getElements('td');
|
||||||
for (let i = 0; i < this.columns.length; ++i) {
|
for (let i = 0; i < this.columns.length; ++i) {
|
||||||
if (Object.prototype.hasOwnProperty.call(data, this.columns[i].dataProperties[0]))
|
if (Object.hasOwn(data, this.columns[i].dataProperties[0]))
|
||||||
this.columns[i].updateTd(tds[i], row);
|
this.columns[i].updateTd(tds[i], row);
|
||||||
}
|
}
|
||||||
row['data'] = {};
|
row['data'] = {};
|
||||||
|
@ -2641,7 +2641,7 @@ window.qBittorrent.DynamicTable = (function() {
|
||||||
|
|
||||||
const tds = tr.getElements('td');
|
const tds = tr.getElements('td');
|
||||||
for (let i = 0; i < this.columns.length; ++i) {
|
for (let i = 0; i < this.columns.length; ++i) {
|
||||||
if (Object.prototype.hasOwnProperty.call(data, this.columns[i].dataProperties[0]))
|
if (Object.hasOwn(data, this.columns[i].dataProperties[0]))
|
||||||
this.columns[i].updateTd(tds[i], row);
|
this.columns[i].updateTd(tds[i], row);
|
||||||
}
|
}
|
||||||
row['data'] = {};
|
row['data'] = {};
|
||||||
|
@ -2786,7 +2786,7 @@ window.qBittorrent.DynamicTable = (function() {
|
||||||
|
|
||||||
const tds = tr.getElements('td');
|
const tds = tr.getElements('td');
|
||||||
for (let i = 0; i < this.columns.length; ++i) {
|
for (let i = 0; i < this.columns.length; ++i) {
|
||||||
if (Object.prototype.hasOwnProperty.call(data, this.columns[i].dataProperties[0]))
|
if (Object.hasOwn(data, this.columns[i].dataProperties[0]))
|
||||||
this.columns[i].updateTd(tds[i], row);
|
this.columns[i].updateTd(tds[i], row);
|
||||||
}
|
}
|
||||||
row['data'] = {};
|
row['data'] = {};
|
||||||
|
@ -3067,7 +3067,7 @@ window.qBittorrent.DynamicTable = (function() {
|
||||||
|
|
||||||
const tds = tr.getElements('td');
|
const tds = tr.getElements('td');
|
||||||
for (let i = 0; i < this.columns.length; ++i) {
|
for (let i = 0; i < this.columns.length; ++i) {
|
||||||
if (Object.prototype.hasOwnProperty.call(data, this.columns[i].dataProperties[0]))
|
if (Object.hasOwn(data, this.columns[i].dataProperties[0]))
|
||||||
this.columns[i].updateTd(tds[i], row);
|
this.columns[i].updateTd(tds[i], row);
|
||||||
}
|
}
|
||||||
row['data'] = {};
|
row['data'] = {};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue