Update config() to config_cache()

This commit is contained in:
Daniel Supernault 2021-05-11 19:07:03 -06:00
parent 1c2baa8f2c
commit c65d03788b
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
5 changed files with 6 additions and 6 deletions

View File

@ -12,7 +12,7 @@ class ImportController extends Controller
{ {
$this->middleware('auth'); $this->middleware('auth');
if(config('pixelfed.import.instagram.enabled') != true) { if(config_cache('pixelfed.import.instagram.enabled') != true) {
abort(404, 'Feature not enabled'); abort(404, 'Feature not enabled');
} }
} }

View File

@ -77,13 +77,13 @@ class SettingsController extends Controller
public function dataImport() public function dataImport()
{ {
abort_if(!config('pixelfed.import.instagram.enabled'), 404); abort_if(!config_cache('pixelfed.import.instagram.enabled'), 404);
return view('settings.import.home'); return view('settings.import.home');
} }
public function dataImportInstagram() public function dataImportInstagram()
{ {
abort_if(!config('pixelfed.import.instagram.enabled'), 404); abort_if(!config_cache('pixelfed.import.instagram.enabled'), 404);
return view('settings.import.instagram.home'); return view('settings.import.instagram.home');
} }

View File

@ -49,7 +49,7 @@ class ImportInstagram implements ShouldQueue
*/ */
public function handle() public function handle()
{ {
if(config('pixelfed.import.instagram.enabled') != true) { if(config_cache('pixelfed.import.instagram.enabled') != true) {
return; return;
} }

View File

@ -59,7 +59,7 @@ class Config {
'stories' => config_cache('instance.stories.enabled'), 'stories' => config_cache('instance.stories.enabled'),
'video' => Str::contains(config_cache('pixelfed.media_types'), 'video/mp4'), 'video' => Str::contains(config_cache('pixelfed.media_types'), 'video/mp4'),
'import' => [ 'import' => [
'instagram' => config('pixelfed.import.instagram.enabled'), 'instagram' => config_cache('pixelfed.import.instagram.enabled'),
'mastodon' => false, 'mastodon' => false,
'pixelfed' => false 'pixelfed' => false
], ],

View File

@ -32,7 +32,7 @@
<li class="nav-item"> <li class="nav-item">
<hr> <hr>
</li> </li>
@if(config('pixelfed.import.instagram.enabled')) @if(config_cache('pixelfed.import.instagram.enabled'))
<li class="nav-item pl-3 {{request()->is('*import*')?'active':''}}"> <li class="nav-item pl-3 {{request()->is('*import*')?'active':''}}">
<a class="nav-link font-weight-light text-muted" href="{{route('settings.import')}}">Import</a> <a class="nav-link font-weight-light text-muted" href="{{route('settings.import')}}">Import</a>
</li> </li>