mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
?admin use JavaScript Optional chaining
This commit is contained in:
parent
17fa031064
commit
1a130d0be3
4 changed files with 9 additions and 9 deletions
|
|
@ -57,7 +57,7 @@ export class AdminSettingsAbout /*extends AbstractViewSettings*/ {
|
||||||
this.coreChecking(true);
|
this.coreChecking(true);
|
||||||
Remote.request('AdminUpdateInfo', (iError, data) => {
|
Remote.request('AdminUpdateInfo', (iError, data) => {
|
||||||
this.coreChecking(false);
|
this.coreChecking(false);
|
||||||
if (!iError && data && data.Result) {
|
if (!iError && data?.Result) {
|
||||||
this.coreReal(true);
|
this.coreReal(true);
|
||||||
this.coreUpdatable(!!data.Result.Updatable);
|
this.coreUpdatable(!!data.Result.Updatable);
|
||||||
this.coreWarning(!!data.Result.Warning);
|
this.coreWarning(!!data.Result.Warning);
|
||||||
|
|
@ -79,7 +79,7 @@ export class AdminSettingsAbout /*extends AbstractViewSettings*/ {
|
||||||
this.coreUpdating(false);
|
this.coreUpdating(false);
|
||||||
this.coreVersion('');
|
this.coreVersion('');
|
||||||
this.coreVersionCompare(-2);
|
this.coreVersionCompare(-2);
|
||||||
if (!iError && data && data.Result) {
|
if (!iError && data?.Result) {
|
||||||
this.coreReal(true);
|
this.coreReal(true);
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -85,7 +85,7 @@ export class AdminSettingsContacts extends AbstractViewSettings {
|
||||||
this.testContactsSuccess(true);
|
this.testContactsSuccess(true);
|
||||||
} else {
|
} else {
|
||||||
this.testContactsError(true);
|
this.testContactsError(true);
|
||||||
if (data && data.Result) {
|
if (data?.Result) {
|
||||||
this.testContactsErrorMessage(data.Result.Message || '');
|
this.testContactsErrorMessage(data.Result.Message || '');
|
||||||
} else {
|
} else {
|
||||||
this.testContactsErrorMessage('');
|
this.testContactsErrorMessage('');
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ export class AdminSettingsGeneral extends AbstractViewSettings {
|
||||||
|
|
||||||
this.uploadData = SettingsGet('PhpUploadSizes');
|
this.uploadData = SettingsGet('PhpUploadSizes');
|
||||||
this.uploadDataDesc =
|
this.uploadDataDesc =
|
||||||
this.uploadData && (this.uploadData.upload_max_filesize || this.uploadData.post_max_size)
|
(this.uploadData?.upload_max_filesize || this.uploadData?.post_max_size)
|
||||||
? [
|
? [
|
||||||
this.uploadData.upload_max_filesize
|
this.uploadData.upload_max_filesize
|
||||||
? 'upload_max_filesize = ' + this.uploadData.upload_max_filesize + '; '
|
? 'upload_max_filesize = ' + this.uploadData.upload_max_filesize + '; '
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,9 @@ export class AdminSettingsPackages extends AbstractViewSettings {
|
||||||
this.packages = PackageAdminStore;
|
this.packages = PackageAdminStore;
|
||||||
|
|
||||||
addComputablesTo(this, {
|
addComputablesTo(this, {
|
||||||
packagesCurrent: () => PackageAdminStore().filter(item => item && item.installed && !item.canBeUpdated),
|
packagesCurrent: () => PackageAdminStore().filter(item => item?.installed && !item.canBeUpdated),
|
||||||
packagesUpdate: () => PackageAdminStore().filter(item => item && item.installed && item.canBeUpdated),
|
packagesUpdate: () => PackageAdminStore().filter(item => item?.installed && item.canBeUpdated),
|
||||||
packagesAvailable: () => PackageAdminStore().filter(item => item && !item.installed),
|
packagesAvailable: () => PackageAdminStore().filter(item => !item?.installed),
|
||||||
|
|
||||||
visibility: () => (PackageAdminStore.loading() ? 'visible' : 'hidden')
|
visibility: () => (PackageAdminStore.loading() ? 'visible' : 'hidden')
|
||||||
});
|
});
|
||||||
|
|
@ -59,7 +59,7 @@ export class AdminSettingsPackages extends AbstractViewSettings {
|
||||||
requestHelper(packageToRequest, install) {
|
requestHelper(packageToRequest, install) {
|
||||||
return (iError, data) => {
|
return (iError, data) => {
|
||||||
PackageAdminStore.forEach(item => {
|
PackageAdminStore.forEach(item => {
|
||||||
if (item && packageToRequest && item.loading && item.loading() && packageToRequest.file === item.file) {
|
if (packageToRequest && item?.loading() && packageToRequest.file === item.file) {
|
||||||
packageToRequest.loading(false);
|
packageToRequest.loading(false);
|
||||||
item.loading(false);
|
item.loading(false);
|
||||||
}
|
}
|
||||||
|
|
@ -113,7 +113,7 @@ export class AdminSettingsPackages extends AbstractViewSettings {
|
||||||
if (iError) {
|
if (iError) {
|
||||||
plugin.enabled(disable);
|
plugin.enabled(disable);
|
||||||
this.packagesError(
|
this.packagesError(
|
||||||
(Notification.UnsupportedPluginPackage === iError && data && data.ErrorMessage)
|
(Notification.UnsupportedPluginPackage === iError && data?.ErrorMessage)
|
||||||
? data.ErrorMessage
|
? data.ErrorMessage
|
||||||
: getNotification(iError)
|
: getNotification(iError)
|
||||||
);
|
);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue