mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
* chore(scripts/twitter): Refactored twitter to use event enums * chore(scripts/marketplace): Refactored marketplace to use event enums * chore(scripts/messages): Refactored messages to use event enums * chore(scripts/contacts): Refactored contacts to use event enums * chore(scripts/calls): Refactored calls to use event enums * chore(scripts/notes): Refactored notes to use event enums * chore(scripts/photos): Refactored photos to use event enums * chore(scripts/bank): Refactored bank to use event enums * chore(scripts/phone): Refactored phone to use event enums * chore(events): Removed old events object * refactor(phone/nui-events): Attached NUI events to respective enum * tweak(event-enums): Added npwd prefix to all events * tweak(phone/serve): Added craco to override CRA without eject Also bumped react-scripts to 4.0.1, with seemingly no issues * fix(typings/twitter): Fixed method enums for twitter
53 lines
1.1 KiB
TypeScript
53 lines
1.1 KiB
TypeScript
import { IAlertProps } from '../../typings/alerts';
|
|
import { BankEvents } from '../../typings/bank';
|
|
|
|
onNet(BankEvents.SEND_TRANSFERS, (transfer: any) => {
|
|
SendNuiMessage(
|
|
JSON.stringify({
|
|
app: 'BANK',
|
|
method: 'setTransaction',
|
|
data: transfer,
|
|
}),
|
|
);
|
|
});
|
|
|
|
onNet(BankEvents.SEND_CREDENTIALS, (credentials: any) => {
|
|
SendNuiMessage(
|
|
JSON.stringify({
|
|
app: 'BANK',
|
|
method: 'setCredentials',
|
|
data: credentials,
|
|
}),
|
|
);
|
|
});
|
|
|
|
RegisterNuiCallbackType(BankEvents.ADD_TRANSFER);
|
|
on(`__cfx_nui:${BankEvents.ADD_TRANSFER}`, (data: any, cb: Function) => {
|
|
emitNet(BankEvents.ADD_TRANSFER, data);
|
|
cb();
|
|
});
|
|
|
|
onNet(BankEvents.ADD_TRANSFER_SUCCESS, () => {
|
|
emitNet(BankEvents.FETCH_TRANSACTIONS);
|
|
});
|
|
|
|
onNet(BankEvents.TRANSACTION_ALERT, (result: IAlertProps) => {
|
|
SendNuiMessage(
|
|
JSON.stringify({
|
|
app: 'BANK',
|
|
method: 'setAlert',
|
|
data: result,
|
|
}),
|
|
);
|
|
});
|
|
|
|
onNet(BankEvents.TRANSACTION_NOTIFICATION, (transfer: any) => {
|
|
SendNuiMessage(
|
|
JSON.stringify({
|
|
app: 'BANK',
|
|
method: 'setNotification',
|
|
data: transfer,
|
|
}),
|
|
);
|
|
});
|