mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 14:38:45 +00:00
feat(phone|resources/bank): useSnackbar for alert
This commit is contained in:
1 parent
1afca13862
commit
47218e63f5
3 files changed
+25
-9
No files matched your search
@@ -103,14 +103,30 @@ onNet(events.BANK_ADD_TRANSFER, async (transfer: Transfer) => {
|
||||
const xTarget = ESX.GetPlayerFromId(transfer.targetID);
|
||||
try {
|
||||
const _identifier = getIdentifier(_source);
|
||||
const transferNotify = await addTransfer(_identifier, transfer);
|
||||
emitNet(events.BANK_TRANSACTION_NOTIFICATION, xTarget, transferNotify);
|
||||
await addTransfer(_identifier, transfer);
|
||||
|
||||
// we need to create a notification for bank. that's why i have commented out.
|
||||
// as well as creating a check if the player has enough money etc....
|
||||
|
||||
//emitNet(events.BANK_TRANSACTION_NOTIFICATION, xTarget, transferNotify);
|
||||
|
||||
emitNet(events.BANK_ADD_TRANSFER_SUCCESS, _source);
|
||||
emitNet(events.BANK_TRANSACTION_ALERT, _source,
|
||||
{
|
||||
message: 'BANK_ALERT_TRANSFER_SUCCESS',
|
||||
type: 'success'
|
||||
}
|
||||
);
|
||||
} catch (e) {
|
||||
bankLogger.error(`Failed to add transaction, ${e.message}`, {
|
||||
source: _source,
|
||||
});
|
||||
emitNet(events.BANK_TRANSACTION_ALERT, _source, false);
|
||||
emitNet(events.BANK_TRANSACTION_ALERT, _source,
|
||||
{
|
||||
message: 'APPS_BANK_ALERT_TRANSFER_FAILURE',
|
||||
type: 'error'
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user