Replace generic console.error handlers with window.cloudron.onError
This commit is contained in:
@@ -26,7 +26,7 @@ async function onChangeMaxEmailSize() {
|
||||
maxEmailSizeBusy.value = true;
|
||||
|
||||
const [error] = await mailModel.setMaxEmailSize(parseInt(maxEmailSize.value));
|
||||
if (error) return console.error(error);
|
||||
if (error) return window.cloudron.onError(error);
|
||||
|
||||
currentMaxEmailSize.value = maxEmailSize.value;
|
||||
maxEmailSizeBusy.value = false;
|
||||
@@ -59,7 +59,7 @@ async function onSubmitAcl() {
|
||||
if (error) {
|
||||
dnsblZonesError.value = error.body ? error.body.message : 'Internal error';
|
||||
dnsblZonesBusy.value = false;
|
||||
return console.error(error);
|
||||
if (error) return window.cloudron.onError(error);
|
||||
}
|
||||
|
||||
aclDialog.value.close();
|
||||
@@ -75,7 +75,7 @@ async function onChangeMailboxSharing(value) {
|
||||
const [error] = await mailModel.setMailboxSharing(value);
|
||||
if (error) {
|
||||
mailboxSharingEnabled.value = !value;
|
||||
return console.error(error);
|
||||
if (error) return window.cloudron.onError(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,7 @@ async function onChangeVirtualAllMail(value) {
|
||||
const [error] = await mailModel.setVirtualAllMail(value);
|
||||
if (error) {
|
||||
virtualAllMailEnabled.value = !value;
|
||||
return console.error(error);
|
||||
if (error) return window.cloudron.onError(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ async function onChangeFts(value) {
|
||||
const [error] = await mailModel.setFtsConfig(value);
|
||||
if (error) {
|
||||
ftsEnabled.value = !value;
|
||||
return console.error(error);
|
||||
if (error) return window.cloudron.onError(error);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -155,43 +155,43 @@ async function onSubmitSpamFilter() {
|
||||
|
||||
onMounted(async () => {
|
||||
let [error, result] = await domainsModel.list();
|
||||
if (error) return console.error(error);
|
||||
if (error) return window.cloudron.onError(error);
|
||||
|
||||
domains.value = result;
|
||||
|
||||
[error, result] = await mailModel.mailboxSharing();
|
||||
if (error) return console.error(error);
|
||||
if (error) return window.cloudron.onError(error);
|
||||
mailboxSharingEnabled.value = result;
|
||||
|
||||
[error, result] = await mailModel.virtualAllMail();
|
||||
if (error) return console.error(error);
|
||||
if (error) return window.cloudron.onError(error);
|
||||
virtualAllMailEnabled.value = result;
|
||||
|
||||
[error, result] = await mailModel.maxEmailSize();
|
||||
if (error) return console.error(error);
|
||||
if (error) return window.cloudron.onError(error);
|
||||
maxEmailSize.value = result;
|
||||
currentMaxEmailSize.value = result;
|
||||
|
||||
[error, result] = await mailModel.dnsblConfig();
|
||||
if (error) return console.error(error);
|
||||
if (error) return window.cloudron.onError(error);
|
||||
dnsblZones.value = result;
|
||||
dnsblZonesString.value = result.join('\n');
|
||||
|
||||
[error, result] = await mailModel.spamCustomConfig();
|
||||
if (error) return console.error(error);
|
||||
if (error) return window.cloudron.onError(error);
|
||||
spamCustomConfig.value = result;
|
||||
|
||||
[error, result] = await mailModel.spamAcl();
|
||||
if (error) return console.error(error);
|
||||
if (error) return window.cloudron.onError(error);
|
||||
allowlist.value = result.allowlist;
|
||||
blocklist.value = result.blocklist;
|
||||
|
||||
[error, result] = await mailModel.ftsConfig();
|
||||
if (error) return console.error(error);
|
||||
if (error) return window.cloudron.onError(error);
|
||||
ftsEnabled.value = result.enabled;
|
||||
|
||||
[error, result] = await servicesModel.get('mail');
|
||||
if (error) return console.error(error);
|
||||
if (error) return window.cloudron.onError(error);
|
||||
hasMailServiceSufficientMemory.value = result.config.memoryLimit >= 3221225472; // we need at least 3GB
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user