Browse Source

Issue #32: Update the clock when reopening the popup.

pull/33/head
Florent Torregrosa 5 months ago
parent
commit
8139a7f9c1
  1. 7
      src/index.ts

7
src/index.ts

@ -6,12 +6,11 @@ import {bootstrapExtra} from "@workadventure/scripting-api-extra"; @@ -6,12 +6,11 @@ import {bootstrapExtra} from "@workadventure/scripting-api-extra";
bootstrapExtra().catch(e => console.error(e));
let currentPopup: any = undefined;
const today = new Date();
const time = today.getHours() + ":" + today.getMinutes();
WA.room.onEnterLayer('clockZone').subscribe(() => {
console.log('toto')
currentPopup = WA.ui.openPopup("clockPopup","It's " + time,[]);
const today = new Date();
const time = today.getHours() + ":" + today.getMinutes();
currentPopup = WA.ui.openPopup("clockPopup","It's " + time,[]);
})
WA.room.onLeaveLayer('clockZone').subscribe(closePopUp)

Loading…
Cancel
Save