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');
if(config('pixelfed.import.instagram.enabled') != true) {
if(config_cache('pixelfed.import.instagram.enabled') != true) {
abort(404, 'Feature not enabled');
}
}

View file

@ -77,13 +77,13 @@ class SettingsController extends Controller
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');
}
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');
}

View file

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

View file

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

View file

@ -32,7 +32,7 @@
<li class="nav-item">
<hr>
</li>
@if(config('pixelfed.import.instagram.enabled'))
@if(config_cache('pixelfed.import.instagram.enabled'))
<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>
</li>