diff --git a/front/dist/service-worker-prod.js b/front/dist/service-worker-prod.js index a524d627..9d6f6cae 100644 --- a/front/dist/service-worker-prod.js +++ b/front/dist/service-worker-prod.js @@ -1,4 +1,4 @@ -let CACHE_NAME = 'workavdenture-cache-v1.4.14'; +let CACHE_NAME = 'workavdenture-cache'; let urlsToCache = [ '/' ]; @@ -14,7 +14,8 @@ self.addEventListener('install', function(event) { }); self.addEventListener('fetch', function(event) { - event.respondWith( + //TODO mamnage fetch data and cache management + /*event.respondWith( caches.match(event.request) .then(function(response) { // Cache hit - return response @@ -44,7 +45,7 @@ self.addEventListener('fetch', function(event) { } ); }) - ); + );*/ }); self.addEventListener('activate', function(event) { diff --git a/front/src/Api/iframe/Sound/Sound.ts b/front/src/Api/iframe/Sound/Sound.ts index 3bb3251a..132176c2 100644 --- a/front/src/Api/iframe/Sound/Sound.ts +++ b/front/src/Api/iframe/Sound/Sound.ts @@ -1,38 +1,35 @@ -import {sendToWorkadventure} from "../IframeApiContribution"; -import type {LoadSoundEvent} from "../../Events/LoadSoundEvent"; -import type {PlaySoundEvent} from "../../Events/PlaySoundEvent"; -import type {StopSoundEvent} from "../../Events/StopSoundEvent"; +import { sendToWorkadventure } from "../IframeApiContribution"; +import type { LoadSoundEvent } from "../../Events/LoadSoundEvent"; +import type { PlaySoundEvent } from "../../Events/PlaySoundEvent"; +import type { StopSoundEvent } from "../../Events/StopSoundEvent"; import SoundConfig = Phaser.Types.Sound.SoundConfig; export class Sound { constructor(private url: string) { sendToWorkadventure({ - "type": 'loadSound', - "data": { + type: "loadSound", + data: { url: this.url, - } as LoadSoundEvent - + } as LoadSoundEvent, }); } - public play(config: SoundConfig) { + public play(config: SoundConfig | undefined) { sendToWorkadventure({ - "type": 'playSound', - "data": { + type: "playSound", + data: { url: this.url, - config - } as PlaySoundEvent - + config, + } as PlaySoundEvent, }); return this.url; } public stop() { sendToWorkadventure({ - "type": 'stopSound', - "data": { + type: "stopSound", + data: { url: this.url, - } as StopSoundEvent - + } as StopSoundEvent, }); return this.url; } diff --git a/front/src/Connexion/LocalUserStore.ts b/front/src/Connexion/LocalUserStore.ts index 87773bf8..db4c3083 100644 --- a/front/src/Connexion/LocalUserStore.ts +++ b/front/src/Connexion/LocalUserStore.ts @@ -18,7 +18,7 @@ const state = "state"; const nonce = "nonce"; const notification = "notificationPermission"; -const cacheAPIIndex = "workavdenture-cache-v1"; +const cacheAPIIndex = "workavdenture-cache"; class LocalUserStore { saveUser(localUser: LocalUser) { diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index d9ed8dc4..f2f4fbc4 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -926,9 +926,10 @@ export class GameScene extends DirtyScene { }); this.gameMap.onPropertyChange("zone", (newValue, oldValue) => { - if (newValue === undefined || newValue === false || newValue === "") { + if (oldValue) { iframeListener.sendLeaveEvent(oldValue as string); - } else { + } + if (newValue) { iframeListener.sendEnterEvent(newValue as string); } }); @@ -951,9 +952,13 @@ export class GameScene extends DirtyScene { return; } const escapedMessage = HtmlUtils.escapeHtml(openPopupEvent.message); - let html = `