/// let currentPopup = undefined; const today = new Date(); const time = today.getHours() + ":" + today.getMinutes(); WA.room.onEnterZone('clock', () => { currentPopup = WA.ui.openPopup("clockPopup","It's " + time,[]); }) WA.room.onLeaveZone('clock', closePopUp) function closePopUp(){ if (currentPopup !== undefined) { currentPopup.close(); currentPopup = undefined; } }