Laravel-Backpack / basset

Better asset helpers for Laravel apps.
MIT License
151 stars 10 forks source link

[Bug] Reorder basset block checks #99

Closed promatik closed 9 months ago

promatik commented 9 months ago

The check if the script is already loaded should come first to avoid injecting same script multiple times in the page.

This bug was only happening with basset blocks, while on dev mode.

pxpm commented 9 months ago

Thanks @promatik

I can confirm that:

 @bassetBlock('test')
    <script>
        console.log('test');
    </script>
    @endBassetBlock

    @bassetBlock('test')
    <script>
        console.log('test');
    </script>
    @endBassetBlock

would render the 2 script blocks in the main branch and in this branch it renders only one as expected.

Cheers