UNPKG

@expofp/floorplan

Version:

Interactive floor plan library for expos and events

2 lines (1 loc) • 754 B
import{DEBUG_KEY as i,SET_KIOSK_KEY as a}from"../constants";import s from"../data";import l,{uiState as m}from"../store";import{handleDebugMode as n}from"../tools/handleDebugMode";import{getRebookingTokenFromQuery as f}from"../tools/rebookingUrl";export function handleCustomCommand(r){if(r=r.trim(),r.toLowerCase()==="__addcache")navigator.serviceWorker.getRegistrations().then(t=>{if(!t.length)return alert("No registered service workers.");const o=[];l.exhibitorStore.exhibitors.forEach(e=>{e.logo?.url&&o.push(e.logo.url),o.push(...e.gallery||[])}),Promise.all(o.map(e=>fetch(e))).then(e=>alert(`${e.length} images loaded.`)).catch(e=>alert(e))});else{if(f())return!0;r.startsWith(i)?n():r===(s.customSetKiosk||a)&&m.enableSetKioskMode(!0)}return!1}