diff --git a/front/src/Phaser/Game/GameScene.ts b/front/src/Phaser/Game/GameScene.ts index fbd8c820..89a039c8 100644 --- a/front/src/Phaser/Game/GameScene.ts +++ b/front/src/Phaser/Game/GameScene.ts @@ -661,18 +661,20 @@ export class GameScene extends ResizableScene implements CenterListener { scale : 1, ease : "EaseOut", duration : 400, - - }); - this.popUpElement.setClassName("popUpElement"); + this.popUpElement.setClassName("popUpElement"); + } else { this.tweens.add({ targets : this.popUpElement , scale : 0, ease : "EaseOut", duration : 400, - + onComplete : () => { + this.popUpElement?.destroy(); + this.popUpElement = undefined; + }, }); } });