Files
new-phone-who-dis/phone/src/apps/email/hooks/useEmailService.ts
T
2021-03-30 02:07:04 -03:00

93 lines
2.8 KiB
TypeScript

import { useSetRecoilState } from 'recoil';
import { IEmail } from '../../../common/typings/email';
import InjectDebugData from '../../../os/debug/InjectDebugData';
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
import { emailState } from './state';
export const useEmailService = () => {
const setEmails = useSetRecoilState(emailState.emails);
useNuiEvent('EMAIL', 'phone:fetchAllEmailsSuccess', setEmails);
};
InjectDebugData<IEmail[]>([
{
app: 'EMAIL',
method: 'phone:fetchAllEmailsSuccess',
data: [
{
id: 1,
subject: 'Try this great app!',
body: 'Hey did you try this email app? Looking good bruh',
receivers: ['[email protected]'],
sender: '[email protected]',
sendDate: Date.now() / 1000,
isRead: false,
},
{
id: 2,
subject: 'Try this great app!',
body: 'Hey did you try this email app? Looking good bruh',
receivers: ['[email protected]'],
sender: '[email protected]',
sendDate: Date.now() / 1000,
isRead: false,
},
{
id: 3,
subject: 'Try this great app!',
body: 'Hey did you try this email app? Looking good bruh',
receivers: ['[email protected]'],
sender: '[email protected]',
sendDate: Date.now() / 1000,
isRead: true,
},
{
id: 4,
subject: 'Try this great app!',
body: 'Hey did you try this email app? Looking good bruh',
receivers: ['[email protected]'],
sender: '[email protected]',
sendDate: Date.now() / 1000,
isRead: true,
},
{
id: 5,
subject: 'Try this great app!',
body: 'Hey did you try this email app? Looking good bruh',
receivers: ['[email protected]'],
sender: '[email protected]',
sendDate: Date.now() / 1000,
isRead: true,
},
{
id: 6,
subject: 'Try this great app!',
body: 'Hey did you try this email app? Looking good bruh',
receivers: ['[email protected]'],
sender: '[email protected]',
sendDate: Date.now() / 1000,
isRead: false,
},
{
id: 7,
subject: 'Try this great app!',
body: 'Hey did you try this email app? Looking good bruh',
receivers: ['[email protected]'],
sender: '[email protected]',
sendDate: Date.now() / 1000,
isRead: false,
},
{
id: 8,
subject: 'Try this great app!',
body: 'Hey did you try this email app? Looking good bruh',
receivers: ['[email protected]'],
sender: '[email protected]',
sendDate: Date.now() / 1000,
isRead: false,
},
],
},
]);