fix(phone/types): Replaced debug inject methods with new enums"

This commit is contained in:
Taso committed 2021-04-01 12:28:14 -04:00
1 parent d315d72e93
commit 8bfdc1b8b2
8 files changed
+18 -13

No files matched your search

@@ -5,11 +5,12 @@ import { GalleryGrid } from './grid/GalleryGrid';
import { GalleryModal } from './modal/GalleryModal'; import { GalleryModal } from './modal/GalleryModal';
import InjectDebugData from '../../../os/debug/InjectDebugData'; import InjectDebugData from '../../../os/debug/InjectDebugData';
import { Route, Switch } from 'react-router-dom'; import { Route, Switch } from 'react-router-dom';
import { PhotoEvents } from '../../../../../typings/photo';
InjectDebugData([ InjectDebugData([
{ {
app: 'CAMERA', app: 'CAMERA',
method: 'setPhotos', method: PhotoEvents.SEND_PHOTOS,
data: [ data: [
{ {
id: 1, id: 1,
@@ -1,8 +1,9 @@
import { useSetRecoilState } from 'recoil'; import { useSetRecoilState } from 'recoil';
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent'; import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
import { photoState } from './state'; import { photoState } from './state';
import { PhotoEvents } from '../../../../../typings/photo';
export const usePhotoService = () => { export const usePhotoService = () => {
const setPhotos = useSetRecoilState(photoState.photos); const setPhotos = useSetRecoilState(photoState.photos);
useNuiEvent('CAMERA', 'setPhotos', setPhotos); useNuiEvent('CAMERA', PhotoEvents.SEND_PHOTOS, setPhotos);
}; };
@@ -9,6 +9,7 @@ import { Route } from 'react-router-dom';
import ContactsInfoPage from './views/ContactInfo'; import ContactsInfoPage from './views/ContactInfo';
import { ContactPage } from './views/ContactsPage'; import { ContactPage } from './views/ContactsPage';
import { ContactsThemeProvider } from '../providers/ContactsThemeProvider'; import { ContactsThemeProvider } from '../providers/ContactsThemeProvider';
import { ContactEvents } from '../../../../../typings/contact';
export const ContactsApp = () => { export const ContactsApp = () => {
const contacts = useApp('CONTACTS'); const contacts = useApp('CONTACTS');
@@ -29,7 +30,7 @@ export const ContactsApp = () => {
InjectDebugData([ InjectDebugData([
{ {
app: 'CONTACTS', app: 'CONTACTS',
method: 'setContacts', method: ContactEvents.SEND_CONTACTS,
data: [ data: [
{ {
id: 1, id: 1,
@@ -11,6 +11,7 @@ import { useDialHistory } from '../hooks/useDialHistory';
import InjectDebugData from '../../../os/debug/InjectDebugData'; import InjectDebugData from '../../../os/debug/InjectDebugData';
import { ContactList } from '../../contacts/components/List/ContactList'; import { ContactList } from '../../contacts/components/List/ContactList';
import { DialerThemeProvider } from '../providers/DialerThemeProvider'; import { DialerThemeProvider } from '../providers/DialerThemeProvider';
import { CallEvents } from '../../../../../typings/call';
export const DialerApp = () => { export const DialerApp = () => {
const history = useDialHistory(); const history = useDialHistory();
@@ -40,7 +41,7 @@ export const DialerApp = () => {
InjectDebugData([ InjectDebugData([
{ {
app: 'DIALER', app: 'DIALER',
method: 'setHistory', method: CallEvents.SET_CALL_HISTORY,
data: [ data: [
{ {
id: 1, id: 1,
+3 -3
View File
@@ -54,7 +54,7 @@ InjectDebugData(
[ [
{ {
app: 'MATCH', app: 'MATCH',
method: 'phone:getMatchProfilesSuccess', method: MatchEvents.GET_PROFILES_SUCCESS,
data: [ data: [
{ {
id: 1, id: 1,
@@ -102,7 +102,7 @@ InjectDebugData(
}, },
{ {
app: 'MATCH', app: 'MATCH',
method: 'phone:getMyProfileSuccess', method: MatchEvents.GET_MY_PROFILE_SUCCESS,
data: { data: {
id: 4, id: 4,
image: image:
@@ -120,7 +120,7 @@ InjectDebugData(
}, },
{ {
app: 'MATCH', app: 'MATCH',
method: 'phone:getMatchesSuccess', method: MatchEvents.GET_MATCHES_SUCCESS,
data: [ data: [
{ {
id: 5, id: 5,
+2 -1
View File
@@ -12,6 +12,7 @@ import useStyles from './notes.styles';
import InjectDebugData from '../../os/debug/InjectDebugData'; import InjectDebugData from '../../os/debug/InjectDebugData';
import { NotesThemeProvider } from './providers/NotesThemeProvider'; import { NotesThemeProvider } from './providers/NotesThemeProvider';
import { Route, useHistory } from 'react-router-dom'; import { Route, useHistory } from 'react-router-dom';
import { NotesEvents } from '../../../../typings/notes';
export const NotesApp = () => { export const NotesApp = () => {
const classes = useStyles(); const classes = useStyles();
@@ -43,7 +44,7 @@ export const NotesApp = () => {
InjectDebugData([ InjectDebugData([
{ {
app: 'NOTES', app: 'NOTES',
method: 'setNotes', method: NotesEvents.SEND_NOTE,
data: [ data: [
{ {
id: 1, id: 1,
@@ -78,7 +78,7 @@ export const TwitterApp = () => {
InjectDebugData([ InjectDebugData([
{ {
app: 'TWITTER', app: 'TWITTER',
method: 'getOrCreateTwitterProfile', method: TwitterEvents.GET_OR_CREATE_PROFILE,
data: { data: {
profile_name: 'Angular_Dev', profile_name: 'Angular_Dev',
bio: 'Angular FTW', bio: 'Angular FTW',
@@ -89,7 +89,7 @@ InjectDebugData([
}, },
{ {
app: 'TWITTER', app: 'TWITTER',
method: 'fetchTweets', method: TwitterEvents.FETCH_TWEETS,
data: [ data: [
{ {
id: 59, id: 59,
@@ -150,7 +150,7 @@ InjectDebugData(
[ [
{ {
app: 'TWITTER', app: 'TWITTER',
method: 'createTweetBroadcast', method: TwitterEvents.CREATE_TWEET_BROADCAST,
data: { data: {
id: 111, id: 111,
profile_id: 111, profile_id: 111,
@@ -162,7 +162,7 @@ InjectDebugData(
}, },
{ {
app: 'TWITTER', app: 'TWITTER',
method: 'createTweetBroadcast', method: TwitterEvents.CREATE_TWEET_BROADCAST,
data: { data: {
id: 111, id: 111,
profile_id: 111, profile_id: 111,
+1 -1
View File
@@ -76,7 +76,7 @@ const handleCameraExit = () => {
}; };
onNet(PhotoEvents.SEND_PHOTOS, (photos: string[]) => { onNet(PhotoEvents.SEND_PHOTOS, (photos: string[]) => {
sendCameraEvent('setPhotos', photos); sendCameraEvent(PhotoEvents.SEND_PHOTOS, photos);
}); });
function takePhoto() { function takePhoto() {