Skip to content

Commit

Permalink
Use the first assetContainer if none is set
Browse files Browse the repository at this point in the history
  • Loading branch information
riasvdv committed Mar 11, 2022
1 parent 7b08642 commit a6fe385
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Fieldtypes/ResponsiveFields.php
Expand Up @@ -2,6 +2,8 @@

namespace Spatie\ResponsiveImages\Fieldtypes;

use Statamic\Facades\AssetContainer;

class ResponsiveFields
{
/** @var array|null */
Expand Down Expand Up @@ -62,7 +64,7 @@ public function getConfig(): array
: '',
'type' => 'assets',
'localizable' => $this->config['localizable'] ?? false,
'container' => $this->config['container'],
'container' => $this->config['container'] ?? AssetContainer::all()->first()?->handle(),
'folder' => $this->config['folder'] ?? '/',
'allow_uploads' => $this->config['allow_uploads'],
'restrict' => $this->config['restrict'] ?? false,
Expand Down

0 comments on commit a6fe385

Please sign in to comment.