feat(slots): update balance handling on spin results
This commit is contained in:
parent
93c5dc7fe3
commit
a3f34e960b
2 changed files with 7 additions and 3 deletions
|
@ -109,17 +109,20 @@ export default class SlotsComponent implements OnInit, OnDestroy {
|
|||
next: (result) => {
|
||||
setTimeout(() => {
|
||||
this.slotResult.set(result);
|
||||
|
||||
|
||||
if (result.status === 'win') {
|
||||
this.userService.updateLocalBalance(result.amount);
|
||||
}
|
||||
|
||||
|
||||
this.userService.refreshCurrentUser();
|
||||
|
||||
this.isSpinning = false;
|
||||
}, 1500);
|
||||
},
|
||||
error: (err) => {
|
||||
console.error('Error spinning slot machine:', err);
|
||||
this.userService.updateLocalBalance(betAmount);
|
||||
this.userService.refreshCurrentUser();
|
||||
this.isSpinning = false;
|
||||
},
|
||||
});
|
||||
|
|
Reference in a new issue