@expofp/floorplan
Version:
Interactive floor plan library for expos and events
2 lines (1 loc) • 557 B
JavaScript
import{DEBUG_KEY as o,DEBUG_STORAGE_KEY as a}from"../constants";export function handleDebugMode(){try{const r=new URL(window.location.href);let t=null,l=null;for(const[e,n]of r.searchParams)if(e===o){t=n,l=e;break}else if(e.startsWith(o+"%3D")||e.startsWith(o+"=")){t=e.split("=")[1],l=e;break}if(t==="1")localStorage.setItem(a,"true");else if(t==="0")localStorage.setItem(a,"false");else return;l&&(r.searchParams.delete(l),window.history.replaceState(null,"",r.toString()),window.location.reload())}catch(r){console.error("Error in handleDebugMode:",r)}}