Jitsi Meet Capture Screen Width

Hi Team

I would like to change some icon when the Width of the screen is <=1024

for that I have written below code to try and capture screen width.

        let iconShow
            iconShow =IconTileViewOverflow;
            iconShow =IconTileView;
    return iconShow

When I reduce the screen Size using mouse to reduce the screen the above code is not hitting the IF condition,
If I use the responsive tool from Developer tool then this works fine.

How could I capture the Screen width when I reduce the width manually using mouse ?

Any thoughts ??

How are you capturing the screen size in your code?