chore: Refactor instanceSettings() function to improve code readability

This commit is contained in:
Andras Bacsai 2024-10-01 10:33:56 +02:00
parent 817bd9c35d
commit 4db50bd025
3 changed files with 7 additions and 3 deletions

View file

@ -60,7 +60,7 @@ class Index extends Component
public function mount()
{
if (isInstanceAdmin()) {
$this->settings = InstanceSettings::get();
$this->settings = instanceSettings();
$this->do_not_track = $this->settings->do_not_track;
$this->is_auto_update_enabled = $this->settings->is_auto_update_enabled;
$this->is_registration_enabled = $this->settings->is_registration_enabled;

View file

@ -89,12 +89,12 @@ public function getTitleDisplayName(): string
public function helperVersion(): Attribute
{
return Attribute::make(
get: function () {
get: function ($value) {
if (isDev()) {
return 'latest';
}
return $this->helper_version;
return $value;
}
);
}

View file

@ -3893,3 +3893,7 @@ function convertComposeEnvironmentToArray($environment)
return $convertedServiceVariables;
}
function instanceSettings()
{
return InstanceSettings::get();
}