chore: Refactor instanceSettings() function to improve code readability
This commit is contained in:
@@ -60,7 +60,7 @@ class Index extends Component
|
|||||||
public function mount()
|
public function mount()
|
||||||
{
|
{
|
||||||
if (isInstanceAdmin()) {
|
if (isInstanceAdmin()) {
|
||||||
$this->settings = InstanceSettings::get();
|
$this->settings = instanceSettings();
|
||||||
$this->do_not_track = $this->settings->do_not_track;
|
$this->do_not_track = $this->settings->do_not_track;
|
||||||
$this->is_auto_update_enabled = $this->settings->is_auto_update_enabled;
|
$this->is_auto_update_enabled = $this->settings->is_auto_update_enabled;
|
||||||
$this->is_registration_enabled = $this->settings->is_registration_enabled;
|
$this->is_registration_enabled = $this->settings->is_registration_enabled;
|
||||||
|
@@ -89,12 +89,12 @@ class InstanceSettings extends Model implements SendsEmail
|
|||||||
public function helperVersion(): Attribute
|
public function helperVersion(): Attribute
|
||||||
{
|
{
|
||||||
return Attribute::make(
|
return Attribute::make(
|
||||||
get: function () {
|
get: function ($value) {
|
||||||
if (isDev()) {
|
if (isDev()) {
|
||||||
return 'latest';
|
return 'latest';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->helper_version;
|
return $value;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -3893,3 +3893,7 @@ function convertComposeEnvironmentToArray($environment)
|
|||||||
return $convertedServiceVariables;
|
return $convertedServiceVariables;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
function instanceSettings()
|
||||||
|
{
|
||||||
|
return InstanceSettings::get();
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user