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