Update SettingsController

This commit is contained in:
Daniel Supernault 2022-02-08 03:30:05 -07:00
parent 119077829d
commit f363a3275a
No known key found for this signature in database
GPG key ID: 0DEF1C662C9033F7

View file

@ -257,7 +257,9 @@ class SettingsController extends Controller
public function mediaSettings(Request $request) public function mediaSettings(Request $request)
{ {
$setting = UserSetting::whereUserId($request->user()->id)->firstOrFail(); $setting = UserSetting::whereUserId($request->user()->id)->firstOrFail();
$compose = $setting->compose_settings ? json_decode($setting->compose_settings, true) : [ $compose = $setting->compose_settings ? (
is_string($setting->compose_settings) ? json_decode($setting->compose_settings, true) : $setting->compose_settings
) : [
'default_license' => null, 'default_license' => null,
'media_descriptions' => false 'media_descriptions' => false
]; ];