From c068a38bf2fa821f51bba556a82b64c547145bd1 Mon Sep 17 00:00:00 2001 From: Yevgeniy Akimenko Date: Mon, 6 Jun 2022 11:55:46 -0700 Subject: [PATCH] small fix for pigeon customization: - set selectedPigeon to the updated value from DB instead of null inside updateSelectedPigeon --- app/http/controllers/profileController.js | 2 +- app/models/Player.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/http/controllers/profileController.js b/app/http/controllers/profileController.js index 647e6fc..0bf440a 100644 --- a/app/http/controllers/profileController.js +++ b/app/http/controllers/profileController.js @@ -32,7 +32,7 @@ const ProfileController = { } if (pigeon.isSelected) { - await req.user.updateSelectedPigeon(pigeon.pigeonId) + await req.user.updateSelectedPigeon(pigeon.pigeonId); } if (pigeon.hueAngle < 0 || pigeon.hueAngle > 100) { diff --git a/app/models/Player.js b/app/models/Player.js index 06cdae2..70c2388 100644 --- a/app/models/Player.js +++ b/app/models/Player.js @@ -123,7 +123,7 @@ const Player = { } await database.playerEntity.updateSelectedPigeon(this.playerId, pigeonId); - this.currentPigeon = null; + this.currentPigeon = database.playerEntity.getSelectedPigeon(this.playerId); }, async countUnlockedPigeons() {