Fix coins not being spent during gift sending

Signed-off-by: Celestora <kitsuruko@gmail.com>
This commit is contained in:
Celestora 2021-10-07 14:27:58 +03:00
parent 5b24aa9494
commit e4706f9c90

View file

@ -86,6 +86,7 @@ final class GiftsPresenter extends OpenVKPresenter
$notification = new GiftNotification($user, $this->user->identity, $gift, $comment); $notification = new GiftNotification($user, $this->user->identity, $gift, $comment);
$notification->emit(); $notification->emit();
$this->user->identity->setCoins($coinsLeft); $this->user->identity->setCoins($coinsLeft);
$this->user->identity->save();
$user->gift($this->user->identity, $gift, $comment, !is_null($this->postParam("anonymous"))); $user->gift($this->user->identity, $gift, $comment, !is_null($this->postParam("anonymous")));
$gift->used(); $gift->used();