forked from mirror/pixelfed
Update LabsSettings controller
This commit is contained in:
parent
c7d97bb864
commit
236fb901a3
1 changed files with 8 additions and 19 deletions
|
@ -32,7 +32,7 @@ trait LabsSettings {
|
||||||
$profile = $request->user()->profile;
|
$profile = $request->user()->profile;
|
||||||
|
|
||||||
$cookie = Cookie::forget('dark-mode');
|
$cookie = Cookie::forget('dark-mode');
|
||||||
if($request->has('dark_mode') && $profile->profile_layout != 'moment') {
|
if($request->has('dark_mode')) {
|
||||||
if($request->dark_mode == 'on') {
|
if($request->dark_mode == 'on') {
|
||||||
$cookie = Cookie::make('dark-mode', true, 43800);
|
$cookie = Cookie::make('dark-mode', true, 43800);
|
||||||
}
|
}
|
||||||
|
@ -42,34 +42,23 @@ trait LabsSettings {
|
||||||
if($profile->profile_layout != 'moment') {
|
if($profile->profile_layout != 'moment') {
|
||||||
$profile->profile_layout = 'moment';
|
$profile->profile_layout = 'moment';
|
||||||
$changes = true;
|
$changes = true;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$profile->profile_layout = null;
|
$profile->profile_layout = null;
|
||||||
$changes = true;
|
$changes = true;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if($profile->profile_layout == 'moment') {
|
|
||||||
$profile->profile_layout = null;
|
|
||||||
$changes = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if($request->has('profile_suggestions')) {
|
if($request->has('profile_suggestions')) {
|
||||||
if($profile->is_suggestable == false) {
|
if($profile->is_suggestable == false) {
|
||||||
$profile->is_suggestable = true;
|
$profile->is_suggestable = true;
|
||||||
$changes = true;
|
$changes = true;
|
||||||
SuggestionService::set($profile->id);
|
SuggestionService::set($profile->id);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
$profile->is_suggestable = false;
|
$profile->is_suggestable = false;
|
||||||
$changes = true;
|
$changes = true;
|
||||||
SuggestionService::del($profile->id);
|
SuggestionService::del($profile->id);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
if($profile->is_suggestable == true) {
|
|
||||||
$profile->is_suggestable = false;
|
|
||||||
$changes = true;
|
|
||||||
SuggestionService::del($profile->id);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if($changes == true) {
|
if($changes == true) {
|
||||||
$profile->save();
|
$profile->save();
|
||||||
|
|
Loading…
Reference in a new issue