Skip to content

A free open source IT asset/license management system

fix bug where company loaded instead of settings

Godfrey M5f8f34ca85fd
diff --git a/app/Livewire/IntegrationSettingsForm.php b/app/Livewire/IntegrationSettingsForm.php
index e356a151c4..d0ed46f557 100644
--- a/app/Livewire/IntegrationSettingsForm.php
+++ b/app/Livewire/IntegrationSettingsForm.php
@@ -83,7 +83,7 @@ class IntegrationSettingsForm extends Component
public function mount(?Company $company = null)
{
- if ($company) {
+ if ($company?->exists) {
$this->company = $company;
}
@@ -348,13 +348,13 @@ class IntegrationSettingsForm extends Component
protected function webhookSource(): Company|Setting
{
- return $this->company ?? Setting::getSettings();
+ return $this->company?->exists ? $this->company : Setting::getSettings();
}
protected function loadWebhookSettings(): void
{
$source = $this->webhookSource();
-
+
$this->webhook_selected = $source->webhook_selected ?: 'slack';
$this->webhook_endpoint = $source->webhook_endpoint;
$this->webhook_channel = $source->webhook_channel;
diff --git a/resources/views/livewire/integration-settings-form.blade.php b/resources/views/livewire/integration-settings-form.blade.php
index 95f033ed36..7aa485e169 100644
--- a/resources/views/livewire/integration-settings-form.blade.php
+++ b/resources/views/livewire/integration-settings-form.blade.php
@@ -47,12 +47,12 @@
</label>
</div>
- <div class="col-md-9 required" wire:ignore>
+ <div class="col-md-9 required">
<x-input.select
name="webhook_selected"
id="select2"
:options="['slack' => trans('admin/settings/general.slack'), 'general' => trans('admin/settings/general.general_webhook'),'google' => trans('admin/settings/general.google_workspaces'), 'microsoft' => trans('admin/settings/general.ms_teams')]"
- :selected="old('webhook_selected', $webhook_selected)"
+ :selected="$webhook_selected"
:disabled="Helper::isDemoMode()"
:for-livewire="true"
data-minimum-results-for-search="-1"