mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
refactor(events): Events are now tied to a common enum typings (#167)
* 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
This commit is contained in:
62 files changed
+4734
-3470
No files matched your search
+10
-10
@@ -1,7 +1,7 @@
|
||||
import { IAlertProps } from '../../typings/alerts';
|
||||
import events from '../utils/events';
|
||||
import { BankEvents } from '../../typings/bank';
|
||||
|
||||
onNet(events.BANK_SEND_TRANSFERS, (transfer: any) => {
|
||||
onNet(BankEvents.SEND_TRANSFERS, (transfer: any) => {
|
||||
SendNuiMessage(
|
||||
JSON.stringify({
|
||||
app: 'BANK',
|
||||
@@ -11,7 +11,7 @@ onNet(events.BANK_SEND_TRANSFERS, (transfer: any) => {
|
||||
);
|
||||
});
|
||||
|
||||
onNet(events.BANK_SEND_CREDENTIALS, (credentials: any) => {
|
||||
onNet(BankEvents.SEND_CREDENTIALS, (credentials: any) => {
|
||||
SendNuiMessage(
|
||||
JSON.stringify({
|
||||
app: 'BANK',
|
||||
@@ -21,17 +21,17 @@ onNet(events.BANK_SEND_CREDENTIALS, (credentials: any) => {
|
||||
);
|
||||
});
|
||||
|
||||
RegisterNuiCallbackType(events.BANK_ADD_TRANSFER);
|
||||
on(`__cfx_nui:${events.BANK_ADD_TRANSFER}`, (data: any, cb: Function) => {
|
||||
emitNet(events.BANK_ADD_TRANSFER, data);
|
||||
RegisterNuiCallbackType(BankEvents.ADD_TRANSFER);
|
||||
on(`__cfx_nui:${BankEvents.ADD_TRANSFER}`, (data: any, cb: Function) => {
|
||||
emitNet(BankEvents.ADD_TRANSFER, data);
|
||||
cb();
|
||||
});
|
||||
|
||||
onNet(events.BANK_ADD_TRANSFER_SUCCESS, () => {
|
||||
emitNet(events.BANK_FETCH_TRANSACTIONS);
|
||||
onNet(BankEvents.ADD_TRANSFER_SUCCESS, () => {
|
||||
emitNet(BankEvents.FETCH_TRANSACTIONS);
|
||||
});
|
||||
|
||||
onNet(events.BANK_TRANSACTION_ALERT, (result: IAlertProps) => {
|
||||
onNet(BankEvents.TRANSACTION_ALERT, (result: IAlertProps) => {
|
||||
SendNuiMessage(
|
||||
JSON.stringify({
|
||||
app: 'BANK',
|
||||
@@ -41,7 +41,7 @@ onNet(events.BANK_TRANSACTION_ALERT, (result: IAlertProps) => {
|
||||
);
|
||||
});
|
||||
|
||||
onNet(events.BANK_TRANSACTION_NOTIFICATION, (transfer: any) => {
|
||||
onNet(BankEvents.TRANSACTION_NOTIFICATION, (transfer: any) => {
|
||||
SendNuiMessage(
|
||||
JSON.stringify({
|
||||
app: 'BANK',
|
||||
|
||||
Reference in new issue
Block a user