Merge pull request #33 from FlorentTorregrosa/update_clock

Issue #32: Update the clock when reopening the popup.
master^2
Valdo 12 months ago committed by GitHub
commit 6c3d83f5a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      src/index.ts

@ -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