You've already forked Epicnabbo-Catalogus-Updated-Daily
🆙 More fixes 🆙
This commit is contained in:
@@ -154,17 +154,22 @@ class EditUser extends EditRecord
|
||||
{
|
||||
$user->currencies->each(function (UserCurrency $currency) use ($data, $user): void {
|
||||
$updatedCurrencyAmount = $data["currency_{$currency->type}"] ?? $currency->amount;
|
||||
$currencyType = match ($currency->type) {
|
||||
if (! is_numeric($updatedCurrencyAmount)) {
|
||||
return;
|
||||
}
|
||||
$updatedCurrencyAmount = (int) $updatedCurrencyAmount;
|
||||
$currencyType = match ((int) $currency->type) {
|
||||
0 => 'duckets',
|
||||
5 => 'diamonds',
|
||||
101 => 'points',
|
||||
default => null,
|
||||
};
|
||||
|
||||
if ($updatedCurrencyAmount == $currency->amount) {
|
||||
if ($currencyType === null || $updatedCurrencyAmount === (int) $currency->amount) {
|
||||
return;
|
||||
}
|
||||
|
||||
app(SendCurrency::class)->execute($user, $currencyType, -$currency->amount + (int) $updatedCurrencyAmount);
|
||||
app(SendCurrency::class)->execute($user, $currencyType, -((int) $currency->amount) + $updatedCurrencyAmount);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user