Removed isNormal() because 'null == undefined' so 'null != value' is sufficient

This commit is contained in:
djmaze 2020-08-17 21:57:56 +02:00
parent 1b811428e7
commit f6a55898c7
13 changed files with 50 additions and 68 deletions

View file

@ -1,5 +1,5 @@
import { ajax } from 'Common/Links';
import { isNormal, pString } from 'Common/Utils';
import { pInt, pString } from 'Common/Utils';
import { DEFAULT_AJAX_TIMEOUT, TOKEN_ERROR_LIMIT, AJAX_ERROR_LIMIT } from 'Common/Consts';
import { Notification } from 'Common/Enums';
import { data as GlobalsData } from 'Common/Globals';
@ -75,7 +75,7 @@ class AbstractAjaxPromises extends AbstractBasicPromises {
if (window.AbortController) {
this.abort(action);
const controller = new AbortController();
setTimeout(() => controller.abort(), isNormal(timeOut) ? timeOut : DEFAULT_AJAX_TIMEOUT);
setTimeout(() => controller.abort(), pInt(timeOut, DEFAULT_AJAX_TIMEOUT));
init.signal = controller.signal;
this.oRequests[action] = controller;
}

View file

@ -1,5 +1,5 @@
import { UNUSED_OPTION_VALUE } from 'Common/Consts';
import { isNormal, pInt } from 'Common/Utils';
import { pInt } from 'Common/Utils';
import { ClientSideKeyName, ServerFolderType } from 'Common/Enums';
import * as Cache from 'Common/Cache';
@ -71,11 +71,11 @@ class PromisesUserPopulator extends AbstractBasicPromises {
Cache.setFolderHash(oCacheFolder.fullNameRaw, oFolder.Extended.Hash);
}
if (isNormal(oFolder.Extended.MessageCount)) {
if (null != oFolder.Extended.MessageCount) {
oCacheFolder.messageCountAll(oFolder.Extended.MessageCount);
}
if (isNormal(oFolder.Extended.MessageUnseenCount)) {
if (null != oFolder.Extended.MessageUnseenCount) {
oCacheFolder.messageCountUnread(oFolder.Extended.MessageUnseenCount);
}
}