Răsfoiți Sursa

Update HomeSettings controller

Daniel Supernault 6 ani în urmă
părinte
comite
dd91f23b53
1 a modificat fișierele cu 9 adăugiri și 0 ștergeri
  1. 9 0
      app/Http/Controllers/Settings/HomeSettings.php

+ 9 - 0
app/Http/Controllers/Settings/HomeSettings.php

@@ -47,6 +47,10 @@ trait HomeSettings
         $email = $request->input('email');
         $email = $request->input('email');
         $user = Auth::user();
         $user = Auth::user();
         $profile = $user->profile;
         $profile = $user->profile;
+        $layout = $request->input('profile_layout');
+        if($layout) {
+            $layout = !in_array($layout, ['metro', 'moment']) ? 'metro' : $layout;
+        }
 
 
         $validate = config('pixelfed.enforce_email_verification');
         $validate = config('pixelfed.enforce_email_verification');
 
 
@@ -89,6 +93,11 @@ trait HomeSettings
                 $changes = true;
                 $changes = true;
                 $profile->bio = $bio;
                 $profile->bio = $bio;
             }
             }
+
+            if ($profile->profile_layout != $layout) {
+                $changes = true;
+                $profile->profile_layout = $layout;
+            }
         }
         }
 
 
         if ($changes === true) {
         if ($changes === true) {