Prettified Code!

This commit is contained in:
itschip authored and GitHub Action committed 2021-01-15 21:08:51 +00:00
1 parent 76aee071a8
commit 5c168c804b
1 file changed
+9 -21
+9 -21
View File
@@ -83,11 +83,7 @@ onNet(
const _identifier = await useIdentifier();
addContact(_identifier, number, display, avatar);
emitNet(events.CONTACTS_ADD_CONTACT_SUCCESS, _source);
emitNet(
events.CONTACTS_ACTION_RESULT,
_source,
"CONTACT_ADD_SUCCESS"
);
emitNet(events.CONTACTS_ACTION_RESULT, _source, "CONTACT_ADD_SUCCESS");
} catch (error) {
const _source = (global as any).source;
emitNet(events.CONTACTS_ACTION_RESULT, _source, "CONTACT_ADD_FAILED");
@@ -96,30 +92,22 @@ onNet(
);
onNet(events.CONTACTS_UPDATE_CONTACT, async (contact: Contacts) => {
console.log('let me just log the contact first', contact);
console.log("let me just log the contact first", contact);
try {
const _source = (global as any).source;
const _identifier = ESX.GetPlayerFromId(_source).getIdentifier();
console.log('nice identifier bro', _identifier);
console.log("nice identifier bro", _identifier);
await updateContact(contact, _identifier);
console.log('i updated the contact server side!');
console.log("i updated the contact server side!");
emitNet(events.CONTACTS_UPDATE_CONTACT_SUCCESS, _source);
console.log('ffs, didd it return successful');
emitNet(
events.CONTACTS_ACTION_RESULT,
_source,
"CONTACT_UPDATE_SUCCESS"
);
console.log("ffs, didd it return successful");
emitNet(events.CONTACTS_ACTION_RESULT, _source, "CONTACT_UPDATE_SUCCESS");
console.log("UPDATED CONTACT: ", contact);
} catch (error) {
const _source = (global as any).source;
emitNet(
events.CONTACTS_ACTION_RESULT,
_source,
"CONTACT_UPDATE_FAILED"
);
emitNet(events.CONTACTS_ACTION_RESULT, _source, "CONTACT_UPDATE_FAILED");
}
});