diff --git a/front/src/Api/iframe/state.ts b/front/src/Api/iframe/state.ts index 90e8cb81..011be1bc 100644 --- a/front/src/Api/iframe/state.ts +++ b/front/src/Api/iframe/state.ts @@ -1,10 +1,10 @@ -import {Observable, Subject} from "rxjs"; +import { Observable, Subject } from "rxjs"; import { EnterLeaveEvent, isEnterLeaveEvent } from "../Events/EnterLeaveEvent"; -import {IframeApiContribution, queryWorkadventure, sendToWorkadventure} from "./IframeApiContribution"; +import { IframeApiContribution, queryWorkadventure, sendToWorkadventure } from "./IframeApiContribution"; import { apiCallback } from "./registeredCallbacks"; -import {isSetVariableEvent, SetVariableEvent} from "../Events/SetVariableEvent"; +import { isSetVariableEvent, SetVariableEvent } from "../Events/SetVariableEvent"; import type { ITiledMap } from "../../Phaser/Map/ITiledMap"; @@ -19,8 +19,7 @@ export const initVariables = (_variables: Map): void => { variables.set(name, value); } } - -} +}; setVariableResolvers.subscribe((event) => { const oldValue = variables.get(event.key); @@ -44,19 +43,19 @@ export class WorkadventureStateCommands extends IframeApiContribution { setVariableResolvers.next(payloadData); - } + }, }), ]; - saveVariable(key : string, value : unknown): Promise { + saveVariable(key: string, value: unknown): Promise { variables.set(key, value); return queryWorkadventure({ - type: 'setVariable', + type: "setVariable", data: { key, - value - } - }) + value, + }, + }); } loadVariable(key: string): unknown { @@ -71,7 +70,6 @@ export class WorkadventureStateCommands extends IframeApiContribution