Skip to content

Commit

Permalink
tweak(contacts): Misc changes to contact handling
Browse files Browse the repository at this point in the history
  • Loading branch information
TasoOneAsia committed Jun 8, 2021
1 parent d036243 commit be8e9bf
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion config.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"showNotifications": true
},
"debug": {
"level": "debug",
"level": "silly",
"enabled": true
}
}
2 changes: 1 addition & 1 deletion phone/src/apps/contacts/components/views/ContactInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ const ContactsInfoPage = () => {
addContact(serverResp.data);
addAlert({
message: t('APPS_CONTACT_ADD_SUCCESS'),
type: 'error',
type: 'success',
});
history.replace(referal);
});
Expand Down
3 changes: 1 addition & 2 deletions phone/src/apps/contacts/hooks/useContactActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,7 @@ export const useContactActions = (): UseContactsValue => {

const deleteContact = useCallback(
(id: number): void => {
const contactIndex = contacts.findIndex((contact) => contact.id === id);
const newContacts = [...contacts].slice(contactIndex);
const newContacts = [...contacts].filter((contact) => contact.id !== id);
setContacts(newContacts);
},
[contacts, setContacts],
Expand Down
5 changes: 2 additions & 3 deletions resources/server/contacts/contacts.service.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import PlayerService from '../players/player.service';
import { contactsLogger } from './contacts.utils';
import ContactsDB, { _ContactsDB } from './contacts.db';
import { Contact, ContactEvents, PreDBContact } from '../../../typings/contact';
import { FxServerResponse } from '../../../typings/phone';
import { ContactServerResp } from './contacts.interfaces';
import { Contact, ContactDeleteDTO, PreDBContact } from '../../../typings/contact';
import { PromiseEventResp, PromiseRequest } from '../utils/PromiseNetEvents/promise.types';

class _ContactService {
private readonly contactsDB: _ContactsDB;
Expand Down

0 comments on commit be8e9bf

Please sign in to comment.