feat(phone|resources/bank): useSnackbar for alert

This commit is contained in:
Christopher committed 2021-02-26 12:48:27 +01:00
1 parent 1afca13862
commit 47218e63f5
3 files changed
+25 -9

No files matched your search

+19 -3
View File
@@ -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'
}
);
}
});