Displaying one-time lightbox pop-up on desktop browser, but never on mobile.

Hello!

I currently have the below text chunk as code in my “Site” tab.

// For full API documentation, including code examples, visit Velo API Reference - Wix.com
import wixWindow from ‘wix-window’;
import { local } from ‘wix-storage’;
$w.onReady( function () {
let isFirstTime = local.getItem(“firstTimePopupShown”);
if (!isFirstTime) {
wixWindow.openLightbox(“email”)
.then((data) => {
let receivedData = data;
local.setItem(“firstTimePopupShown”, true );
});
} else {
console.log(“Not first time”);
}


However, my goal is to only have this lightbox pop-up appear once per machine on PC, and NEVER on mobile browsers. What would I need to adjust, or add, to the aforementioned code for the lightbox to behave this way?

Any help from the community would be greatly appreciated.

https://support.wix.com/en/article/hiding-a-lightbox-on-your-mobile-site

Sorry brain freeze as that will only work if you have lightbox set to yes for trigger automatically.

You can look at using Wix Window formFactor and writing the code so that the lightbox appears on desktop only.
https://www.wix.com/corvid/reference/wix-window.html#formFactor

Here is an example for mobile only code with Wix, you’ll just need to change it to suit your own site for desktop only.
https://support.wix.com/en/article/corvid-tutorial-displaying-elements-in-mobile-only
https://support.wix.com/en/article/corvid-writing-code-that-only-runs-on-mobile-devices

I’ve used it for simple tasks like here…

import wixWindow from 'wix-window';

$w.onReady(function () {
if(wixWindow.formFactor === "Mobile"){
$w("#mobilelogo").show();
$w("#mobilelogo1").show();
$w("#menuheaderstrip").show();
}
});
import wixWindow from 'wix-window';

$w.onReady(function () {
if(wixWindow.formFactor === "Mobile"){
$w("#mobilelogo").show();
$w("#mobilemenuopen").show();
$w("#mobilemenuclose").show();
}
$w("#mobilemenuopen").onClick( () => {
$w("#myMenuContainer").open();
} )
$w("#mobilemenuclose").onClick( () => {
$w("#myMenuContainer").close();
} )
} );

Sorry, but I’m not really following.

I’m unclear on what code I need to write in (or adjust to my aforementioned code block) for the lightbox to display only once per machine on PC but never on mobile.

Could you be a little more clear with me?