Skip to content

Commit 4db50bd

Browse files
committed
chore: Refactor instanceSettings() function to improve code readability
1 parent 817bd9c commit 4db50bd

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

app/Livewire/Settings/Index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class Index extends Component
6060
public function mount()
6161
{
6262
if (isInstanceAdmin()) {
63-
$this->settings = InstanceSettings::get();
63+
$this->settings = instanceSettings();
6464
$this->do_not_track = $this->settings->do_not_track;
6565
$this->is_auto_update_enabled = $this->settings->is_auto_update_enabled;
6666
$this->is_registration_enabled = $this->settings->is_registration_enabled;

app/Models/InstanceSettings.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ public function getTitleDisplayName(): string
8989
public function helperVersion(): Attribute
9090
{
9191
return Attribute::make(
92-
get: function () {
92+
get: function ($value) {
9393
if (isDev()) {
9494
return 'latest';
9595
}
9696

97-
return $this->helper_version;
97+
return $value;
9898
}
9999
);
100100
}

bootstrap/helpers/shared.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3893,3 +3893,7 @@ function convertComposeEnvironmentToArray($environment)
38933893
return $convertedServiceVariables;
38943894

38953895
}
3896+
function instanceSettings()
3897+
{
3898+
return InstanceSettings::get();
3899+
}

0 commit comments

Comments
 (0)