An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.
PHP coolifydatabasesdeploymentdockerdocker-composeinertiajslaravelmariadbmysqlnextjsnodejsphppostgresredisself-hostedself-hostingserverstatic-sitesveltesvelte5
fix(core): improve instantSave logic and error handling
Andras Bacsai8a11de9b1a8b
diff --git a/app/Livewire/SettingsEmail.php b/app/Livewire/SettingsEmail.phpindex 15e68306f5..4205594a52 100644--- a/app/Livewire/SettingsEmail.php+++ b/app/Livewire/SettingsEmail.php@@ -114,19 +114,24 @@ class SettingsEmail extends Componentpublic function instantSave(string $type){try {+ $currentSmtpEnabled = $this->settings->smtp_enabled;+ $currentResendEnabled = $this->settings->resend_enabled;$this->resetErrorBag();if ($type === 'SMTP') {$this->submitSmtp();+ $this->resendEnabled = $this->settings->resend_enabled = false;} elseif ($type === 'Resend') {$this->submitResend();+ $this->smtpEnabled = $this->settings->smtp_enabled = false;}+ $this->settings->save();} catch (\Throwable $e) {if ($type === 'SMTP') {- $this->smtpEnabled = false;+ $this->smtpEnabled = $currentSmtpEnabled;} elseif ($type === 'Resend') {- $this->resendEnabled = false;+ $this->resendEnabled = $currentResendEnabled;}return handleError($e, $this);@@ -156,9 +161,6 @@ class SettingsEmail extends Component'smtpEncryption.required' => 'Encryption type is required.',]);- $this->resendEnabled = false;- $this->settings->resend_enabled = false;-$this->settings->smtp_enabled = $this->smtpEnabled;$this->settings->smtp_host = $this->smtpHost;$this->settings->smtp_port = $this->smtpPort;@@ -194,9 +196,6 @@ class SettingsEmail extends Component'smtpFromName.required' => 'From Name is required.',]);- $this->smtpEnabled = false;- $this->settings->smtp_enabled = false;-$this->settings->resend_enabled = $this->resendEnabled;$this->settings->resend_api_key = $this->resendApiKey;$this->settings->smtp_from_address = $this->smtpFromAddress;