mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
fix(bank): update all events
This commit is contained in:
1 parent
5654e1f46f
commit
de10ce92b2
3 files changed
+8
-4
No files matched your search
@@ -7,6 +7,7 @@ import { useBankNotification } from './useBankNotification';
|
|||||||
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
|
import { IAlert, useSnackbar } from '../../../ui/hooks/useSnackbar';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { BankEvents } from '../../../../../typings/bank';
|
import { BankEvents } from '../../../../../typings/bank';
|
||||||
|
import { PhoneEvents } from '../../../../../typings/phone';
|
||||||
|
|
||||||
export const useBankService = () => {
|
export const useBankService = () => {
|
||||||
const setTransaction = useSetRecoilState(bankState.transactions);
|
const setTransaction = useSetRecoilState(bankState.transactions);
|
||||||
@@ -24,7 +25,7 @@ export const useBankService = () => {
|
|||||||
|
|
||||||
useNuiEvent('BANK', BankEvents.SEND_TRANSFERS, setTransaction);
|
useNuiEvent('BANK', BankEvents.SEND_TRANSFERS, setTransaction);
|
||||||
useNuiEvent('BANK', BankEvents.SEND_CREDENTIALS, setCredentials);
|
useNuiEvent('BANK', BankEvents.SEND_CREDENTIALS, setCredentials);
|
||||||
useNuiEvent('BANK', 'setAlert', handleAddAlert);
|
useNuiEvent('BANK', PhoneEvents.SET_ALERT, handleAddAlert);
|
||||||
useNuiEvent('BANK', 'setNotification', setNotification);
|
useNuiEvent('BANK', PhoneEvents.SET_NOTIFICATION, setNotification);
|
||||||
return { useTransactions, useCredentials, useBankNotification };
|
return { useTransactions, useCredentials, useBankNotification };
|
||||||
};
|
};
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import { IAlertProps } from '../../typings/alerts';
|
import { IAlertProps } from '../../typings/alerts';
|
||||||
import { BankEvents } from '../../typings/bank';
|
import { BankEvents } from '../../typings/bank';
|
||||||
|
import { PhoneEvents } from '../../typings/phone';
|
||||||
|
|
||||||
onNet(BankEvents.SEND_TRANSFERS, (transfer: any) => {
|
onNet(BankEvents.SEND_TRANSFERS, (transfer: any) => {
|
||||||
SendNuiMessage(
|
SendNuiMessage(
|
||||||
@@ -35,7 +36,7 @@ onNet(BankEvents.TRANSACTION_ALERT, (result: IAlertProps) => {
|
|||||||
SendNuiMessage(
|
SendNuiMessage(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
app: 'BANK',
|
app: 'BANK',
|
||||||
method: 'setAlert',
|
method: PhoneEvents.SET_ALERT,
|
||||||
data: result,
|
data: result,
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
@@ -45,7 +46,7 @@ onNet(BankEvents.TRANSACTION_NOTIFICATION, (transfer: any) => {
|
|||||||
SendNuiMessage(
|
SendNuiMessage(
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
app: 'BANK',
|
app: 'BANK',
|
||||||
method: 'setNotification',
|
method: PhoneEvents.SET_NOTIFICATION,
|
||||||
data: transfer,
|
data: transfer,
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -8,4 +8,6 @@ export enum PhoneEvents {
|
|||||||
OPEN_APP_DAILER = 'npwd:app:DIALER',
|
OPEN_APP_DAILER = 'npwd:app:DIALER',
|
||||||
OPEN_PHONE = 'npwd:open',
|
OPEN_PHONE = 'npwd:open',
|
||||||
CLOSE_PHONE = 'npwd:close',
|
CLOSE_PHONE = 'npwd:close',
|
||||||
|
SET_ALERT = 'npwd:setAlert',
|
||||||
|
SET_NOTIFICATION = 'npwd:setNotification',
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user