mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 20:19:22 +03:00
Removed isNormal() because 'null == undefined' so 'null != value' is sufficient
This commit is contained in:
parent
1b811428e7
commit
f6a55898c7
13 changed files with 50 additions and 68 deletions
|
|
@ -8,7 +8,7 @@ import {
|
|||
bMobileDevice
|
||||
} from 'Common/Globals';
|
||||
|
||||
import { isNormal, pString, detectDropdownVisibility, windowResizeCallback } from 'Common/Utils';
|
||||
import { pString, detectDropdownVisibility, windowResizeCallback } from 'Common/Utils';
|
||||
|
||||
import { KeyState } from 'Common/Enums';
|
||||
import { root, rootAdmin, rootUser, populateAuthSuffix } from 'Common/Links';
|
||||
|
|
@ -114,7 +114,7 @@ class AbstractApp extends AbstractBoot {
|
|||
* @param {string} title
|
||||
*/
|
||||
setWindowTitle(title) {
|
||||
title = isNormal(title) && title.length ? '' + title : '';
|
||||
title = pString(title);
|
||||
if (Settings.settingsGet('Title')) {
|
||||
title += (title ? ' - ' : '') + Settings.settingsGet('Title');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import ko from 'ko';
|
|||
import { root } from 'Common/Links';
|
||||
import { getNotification } from 'Common/Translator';
|
||||
import { StorageResultType, Notification } from 'Common/Enums';
|
||||
import { pInt, isNormal } from 'Common/Utils';
|
||||
import { pInt } from 'Common/Utils';
|
||||
|
||||
import * as Settings from 'Storage/Settings';
|
||||
|
||||
|
|
@ -153,7 +153,7 @@ class AdminApp extends AbstractApp {
|
|||
LicenseStore.licenseError('');
|
||||
Remote.licensing((result, data) => {
|
||||
LicenseStore.licensingProcess(false);
|
||||
if (StorageResultType.Success === result && data && data.Result && isNormal(data.Result.Expired)) {
|
||||
if (StorageResultType.Success === result && data && data.Result && null != data.Result.Expired) {
|
||||
LicenseStore.licenseValid(true);
|
||||
LicenseStore.licenseExpired(pInt(data.Result.Expired));
|
||||
LicenseStore.licenseError('');
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
import {
|
||||
isNormal,
|
||||
isPosNumeric,
|
||||
isNonEmptyArray,
|
||||
pInt,
|
||||
|
|
@ -625,11 +624,11 @@ class AppUser extends AbstractApp {
|
|||
setFolderHash(data.Result.Folder, data.Result.Hash);
|
||||
}
|
||||
|
||||
if (isNormal(data.Result.MessageCount)) {
|
||||
if (null != data.Result.MessageCount) {
|
||||
folderFromCache.messageCountAll(data.Result.MessageCount);
|
||||
}
|
||||
|
||||
if (isNormal(data.Result.MessageUnseenCount)) {
|
||||
if (null != data.Result.MessageUnseenCount) {
|
||||
if (pInt(folderFromCache.messageCountUnread()) !== pInt(data.Result.MessageUnseenCount)) {
|
||||
unreadCountChange = true;
|
||||
}
|
||||
|
|
@ -707,11 +706,11 @@ class AppUser extends AbstractApp {
|
|||
setFolderHash(item.Folder, item.Hash);
|
||||
}
|
||||
|
||||
if (isNormal(item.MessageCount)) {
|
||||
if (null != item.MessageCount) {
|
||||
folder.messageCountAll(item.MessageCount);
|
||||
}
|
||||
|
||||
if (isNormal(item.MessageUnseenCount)) {
|
||||
if (null != item.MessageUnseenCount) {
|
||||
if (pInt(folder.messageCountUnread()) !== pInt(item.MessageUnseenCount)) {
|
||||
unreadCountChange = true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue