DEV: Don't use `$.isEmptyObject()` (#14953)

This commit is contained in:
Jarek Radosz 2021-11-15 23:17:56 +01:00 committed by GitHub
parent eabe2df8d2
commit f4d1fe18f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -237,7 +237,8 @@ export default class {
] = 1;
}
Object.keys(newTimings).forEach((postNumber) => {
const newTimingsKeys = Object.keys(newTimings);
newTimingsKeys.forEach((postNumber) => {
highestSeen = Math.max(highestSeen, parseInt(postNumber, 10));
});
@ -248,7 +249,7 @@ export default class {
this.topicTrackingState.updateSeen(topicId, highestSeen);
if (!$.isEmptyObject(newTimings)) {
if (newTimingsKeys.length > 0) {
if (this.currentUser && !isTesting()) {
this.consolidateTimings(newTimings, this._topicTime, topicId);
this.sendNextConsolidatedTiming();
@ -267,6 +268,7 @@ export default class {
} else {
topicIds = [];
}
if (
topicIds.indexOf(topicId) === -1 &&
topicIds.length < ANON_MAX_TOPIC_IDS