How to enable or disable infinite scroll using code?

Hello,

I have a block that I used as a query loop and it is currently on pagination on desktop but I want to enable the infinite scroll on mobile.

I tried creating a filter with bricks/element/settings and bricks/posts/query_vars but still doesnt work.

So how I can enable or disable the infinite scroll using code? either js or php

Thanks!

I think you can create another block to be specific to each device. I know it’s quite cumbersome but it would be a simple measure