mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-05 06:28:51 +00:00
Merge pull request #79 from project-error/fix/notes-handling
Fix/notes handling
This commit is contained in:
13 files changed
+169
-42
No files matched your search
@@ -15,6 +15,7 @@ import { useNoteDetail } from './hooks/useNoteDetail';
|
|||||||
|
|
||||||
import useStyles from './notes.styles';
|
import useStyles from './notes.styles';
|
||||||
import InjectDebugData from '../../os/debug/InjectDebugData';
|
import InjectDebugData from '../../os/debug/InjectDebugData';
|
||||||
|
import { NotesAlert } from './alert/NotesAlert';
|
||||||
|
|
||||||
InjectDebugData([
|
InjectDebugData([
|
||||||
{
|
{
|
||||||
@@ -32,7 +33,7 @@ InjectDebugData([
|
|||||||
content: 'Hello, this is another shitty note',
|
content: 'Hello, this is another shitty note',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
export const NotesApp = () => {
|
export const NotesApp = () => {
|
||||||
@@ -54,7 +55,8 @@ export const NotesApp = () => {
|
|||||||
<NoteModal key={detail?.id} />
|
<NoteModal key={detail?.id} />
|
||||||
<AppContent>
|
<AppContent>
|
||||||
<NoteList notes={notes} />
|
<NoteList notes={notes} />
|
||||||
<Fab
|
</AppContent>
|
||||||
|
<Fab
|
||||||
className={classes.absolute}
|
className={classes.absolute}
|
||||||
onClick={handleModal}
|
onClick={handleModal}
|
||||||
style={{
|
style={{
|
||||||
@@ -64,7 +66,7 @@ export const NotesApp = () => {
|
|||||||
>
|
>
|
||||||
<AddIcon />
|
<AddIcon />
|
||||||
</Fab>
|
</Fab>
|
||||||
</AppContent>
|
<NotesAlert />
|
||||||
</AppWrapper>
|
</AppWrapper>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -0,0 +1,62 @@
|
|||||||
|
import React, { useState, useEffect, useCallback } from 'react'
|
||||||
|
import { Snackbar } from '@material-ui/core';
|
||||||
|
import { Alert } from '../../../ui/components/Alert';
|
||||||
|
import { AlertCategory } from '../../../common/typings/notes';
|
||||||
|
import { useTranslation } from 'react-i18next';
|
||||||
|
import { useNotesAlert } from '../hooks/useNoteAlert';
|
||||||
|
|
||||||
|
const LOCALE_PREFIX = 'APPS_';
|
||||||
|
|
||||||
|
export const NotesAlert = () => {
|
||||||
|
const { t } = useTranslation();
|
||||||
|
const [open, setOpen] = useState(false);
|
||||||
|
const { alert, setAlert } = useNotesAlert();
|
||||||
|
const [message, setMessage] = useState(null);
|
||||||
|
const [severity, setSeverity] = useState('');
|
||||||
|
|
||||||
|
const _handleClose = () => {
|
||||||
|
setOpen(false)
|
||||||
|
setAlert(null)
|
||||||
|
}
|
||||||
|
|
||||||
|
const setMessageAlert = useCallback((type: AlertCategory, severity: 'success' | 'error') => {
|
||||||
|
setMessage(t(LOCALE_PREFIX + type));
|
||||||
|
setSeverity(severity)
|
||||||
|
setOpen(true)
|
||||||
|
}, [t])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
switch (alert) {
|
||||||
|
case 'NOTES_ADD_SUCCESS':
|
||||||
|
setMessageAlert(alert, 'success');
|
||||||
|
break;
|
||||||
|
case 'NOTES_ADD_FAILED':
|
||||||
|
setMessageAlert(alert, 'error');
|
||||||
|
break;
|
||||||
|
case 'NOTES_UPDATE_SUCCESS':
|
||||||
|
setMessageAlert(alert, 'success');
|
||||||
|
break;
|
||||||
|
case 'NOTES_UPDATE_FAILED':
|
||||||
|
setMessageAlert(alert, 'error');
|
||||||
|
break;
|
||||||
|
case 'NOTES_DELETE_SUCCESS':
|
||||||
|
setMessageAlert(alert, 'success');
|
||||||
|
break;
|
||||||
|
case 'NOTES_DELETE_FAILED':
|
||||||
|
setMessageAlert(alert, 'error')
|
||||||
|
}
|
||||||
|
}, [alert, setMessageAlert])
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Snackbar
|
||||||
|
style={{ width: '80%', position: 'absolute', bottom: '10%' }}
|
||||||
|
autoHideDuration={1500}
|
||||||
|
open={open}
|
||||||
|
onClose={_handleClose}
|
||||||
|
>
|
||||||
|
<Alert severity={severity} variant='filled'>
|
||||||
|
{message}
|
||||||
|
</Alert>
|
||||||
|
</Snackbar>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -13,4 +13,8 @@ export const noteStates = {
|
|||||||
key: 'noteDetail',
|
key: 'noteDetail',
|
||||||
default: null,
|
default: null,
|
||||||
}),
|
}),
|
||||||
|
alert: atom({
|
||||||
|
key: 'notesAlert',
|
||||||
|
default: null
|
||||||
|
})
|
||||||
};
|
};
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import { useRecoilState } from 'recoil';
|
||||||
|
import { INotesAlert } from '../../../common/typings/notes';
|
||||||
|
import { noteStates } from './state';
|
||||||
|
|
||||||
|
export const useNotesAlert = (): INotesAlert => {
|
||||||
|
const [alert, setAlert] = useRecoilState(noteStates.alert)
|
||||||
|
return { alert, setAlert }
|
||||||
|
}
|
||||||
@@ -2,9 +2,12 @@ import { useSetRecoilState } from 'recoil';
|
|||||||
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
|
import { useNuiEvent } from '../../../os/nui-events/hooks/useNuiEvent';
|
||||||
import { useNotes } from './useNotes';
|
import { useNotes } from './useNotes';
|
||||||
import { noteStates } from './state';
|
import { noteStates } from './state';
|
||||||
|
import { useNotesAlert } from './useNoteAlert';
|
||||||
|
|
||||||
export const useNotesService = () => {
|
export const useNotesService = () => {
|
||||||
const setNotes = useSetRecoilState(noteStates.noteItems);
|
const setNotes = useSetRecoilState(noteStates.noteItems);
|
||||||
|
const setAlert = useSetRecoilState(noteStates.alert);
|
||||||
useNuiEvent('NOTES', 'setNotes', setNotes);
|
useNuiEvent('NOTES', 'setNotes', setNotes);
|
||||||
return useNotes();
|
useNuiEvent('NOTES', 'setAlert', setAlert)
|
||||||
|
return { useNotes, useNotesAlert };
|
||||||
};
|
};
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Button, TextField, Slide } from '@material-ui/core';
|
import { Button, TextField, Slide } from '@material-ui/core';
|
||||||
import React, { useState } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import ArrowBackIcon from '@material-ui/icons/ArrowBack';
|
import ArrowBackIcon from '@material-ui/icons/ArrowBack';
|
||||||
|
|
||||||
import { useNoteModal } from '../hooks/useNoteModal';
|
import { useNoteModal } from '../hooks/useNoteModal';
|
||||||
@@ -14,33 +14,37 @@ import Nui from '../../../os/nui-events/utils/Nui';
|
|||||||
export const NoteModal = () => {
|
export const NoteModal = () => {
|
||||||
const { noteModal, setNoteModal } = useNoteModal();
|
const { noteModal, setNoteModal } = useNoteModal();
|
||||||
const { detail, setDetail } = useNoteDetail();
|
const { detail, setDetail } = useNoteDetail();
|
||||||
console.log(detail);
|
|
||||||
const [title, setTitle] = useState(detail ? detail.title : '');
|
const [title, setTitle] = useState(detail ? detail.title : '');
|
||||||
const [content, setContent] = useState(detail ? detail.content : '');
|
const [content, setContent] = useState(detail ? detail.content : '');
|
||||||
|
|
||||||
const classes = useStyles();
|
const classes = useStyles()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const _handleClose = () => {
|
const _handleClose = () => {
|
||||||
setNoteModal(false);
|
|
||||||
setDetail(null);
|
setDetail(null);
|
||||||
|
setNoteModal(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleNoteSave = () => {
|
const handleNoteSave = () => {
|
||||||
setNoteModal(false);
|
|
||||||
setDetail(null);
|
|
||||||
Nui.send('phone:addNote', {
|
Nui.send('phone:addNote', {
|
||||||
title,
|
title,
|
||||||
content,
|
content,
|
||||||
});
|
});
|
||||||
|
setDetail(null);
|
||||||
|
setNoteModal(false);
|
||||||
|
|
||||||
|
setTitle('')
|
||||||
|
setContent('')
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleDeleteNote = () => {
|
const handleDeleteNote = () => {
|
||||||
const id = detail.id;
|
const id = detail.id;
|
||||||
setNoteModal(false);
|
|
||||||
Nui.send('phone:deleteNote', {
|
Nui.send('phone:deleteNote', {
|
||||||
id,
|
id,
|
||||||
});
|
});
|
||||||
setDetail(null);
|
setDetail(null);
|
||||||
|
setNoteModal(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleUpdateNote = () => {
|
const handleUpdateNote = () => {
|
||||||
@@ -49,8 +53,8 @@ export const NoteModal = () => {
|
|||||||
title,
|
title,
|
||||||
content,
|
content,
|
||||||
});
|
});
|
||||||
setNoteModal(false);
|
|
||||||
setDetail(null);
|
setDetail(null);
|
||||||
|
setNoteModal(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -63,9 +67,11 @@ export const NoteModal = () => {
|
|||||||
<div id='notes-modal' className={classes.noteContainer}>
|
<div id='notes-modal' className={classes.noteContainer}>
|
||||||
<TextField
|
<TextField
|
||||||
className={classes.input}
|
className={classes.input}
|
||||||
|
rowsMax={1}
|
||||||
placeholder='Title'
|
placeholder='Title'
|
||||||
inputProps={{
|
inputProps={{
|
||||||
className: classes.inputPropsTitle,
|
className: classes.inputPropsTitle,
|
||||||
|
maxLength: 25
|
||||||
}}
|
}}
|
||||||
fullWidth
|
fullWidth
|
||||||
value={title}
|
value={title}
|
||||||
@@ -75,6 +81,7 @@ export const NoteModal = () => {
|
|||||||
className={classes.input}
|
className={classes.input}
|
||||||
inputProps={{
|
inputProps={{
|
||||||
className: classes.inputPropsContent,
|
className: classes.inputPropsContent,
|
||||||
|
maxLength: 250,
|
||||||
}}
|
}}
|
||||||
placeholder='Content'
|
placeholder='Content'
|
||||||
multiline
|
multiline
|
||||||
@@ -84,8 +91,9 @@ export const NoteModal = () => {
|
|||||||
value={content}
|
value={content}
|
||||||
onChange={(e) => setContent(e.target.value)}
|
onChange={(e) => setContent(e.target.value)}
|
||||||
/>
|
/>
|
||||||
{!detail && (
|
<p style={{ color: "#fff" }}>{content.length}/250</p>
|
||||||
<Button className={classes.saveButton} onClick={handleNoteSave}>
|
{!detail &&(
|
||||||
|
<Button disabled={title.length > 0 ? false : true} className={classes.saveButton} onClick={handleNoteSave}>
|
||||||
Save
|
Save
|
||||||
</Button>
|
</Button>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -1,3 +1,18 @@
|
|||||||
|
export type AlertCategory =
|
||||||
|
| 'NOTES_ADD_SUCCESS'
|
||||||
|
| 'NOTES_ADD_FAILED'
|
||||||
|
| 'NOTES_UPDATE_SUCCESS'
|
||||||
|
| 'NOTES_UPDATE_FAILED'
|
||||||
|
| 'NOTES_DELETE_SUCCESS'
|
||||||
|
| 'NOTES_DELETE_FAILED'
|
||||||
|
|
||||||
|
|
||||||
|
export interface INotesAlert {
|
||||||
|
alert: AlertCategory;
|
||||||
|
setAlert: (type: AlertCategory) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
export interface Note {
|
export interface Note {
|
||||||
id?: number;
|
id?: number;
|
||||||
title: string;
|
title: string;
|
||||||
|
|||||||
@@ -84,6 +84,13 @@
|
|||||||
"APPS_CONTACT_MODAL_PLACEHOLDER_AVATAR": "Avatar",
|
"APPS_CONTACT_MODAL_PLACEHOLDER_AVATAR": "Avatar",
|
||||||
"APPS_CONTACT_MODAL_BUTTON_ADD": "Add Contact",
|
"APPS_CONTACT_MODAL_BUTTON_ADD": "Add Contact",
|
||||||
|
|
||||||
|
"APPS_NOTES_ADD_SUCCESS": "Successfully saved note.",
|
||||||
|
"APPS_NOTES_ADD_FAILED": "Failed to save note.",
|
||||||
|
"APPS_NOTES_UPDATE_SUCCESS": "Successfully updated note.",
|
||||||
|
"APPS_NOTES_UPDATE_FAILED": "Failed to update note.",
|
||||||
|
"APPS_NOTES_DELETE_SUCCESS": "Successfully deleted note.",
|
||||||
|
"APPS_NOTES_DELETE_FAILED": "Failed to delete note.",
|
||||||
|
|
||||||
"APPS_SETTINGS_PHONE_NUMBER": "Phone Number",
|
"APPS_SETTINGS_PHONE_NUMBER": "Phone Number",
|
||||||
"APPS_SETTINGS_OPTION_WALLPAPER": "Wallpaper",
|
"APPS_SETTINGS_OPTION_WALLPAPER": "Wallpaper",
|
||||||
"APPS_SETTINGS_OPTION_FRAME": "Frame",
|
"APPS_SETTINGS_OPTION_FRAME": "Frame",
|
||||||
@@ -92,6 +99,7 @@
|
|||||||
"APPS_SETTINGS_OPTION_RINGTONE": "Ringtone",
|
"APPS_SETTINGS_OPTION_RINGTONE": "Ringtone",
|
||||||
"APPS_SETTINGS_OPTION_RINGTONEVOL": "Ringtone Volume",
|
"APPS_SETTINGS_OPTION_RINGTONEVOL": "Ringtone Volume",
|
||||||
|
|
||||||
|
"GENERIC_SAVE": "Save",
|
||||||
"GENERIC_UPDATE": "Update",
|
"GENERIC_UPDATE": "Update",
|
||||||
"GENERIC_DELETE": "Delete"
|
"GENERIC_DELETE": "Delete"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,13 @@
|
|||||||
import events from '../utils/events';
|
import events from '../utils/events';
|
||||||
|
import { sendNotesEvent } from '../utils/messages';
|
||||||
|
|
||||||
onNet(events.NOTE_SEND_NOTE, (notes: any) => {
|
onNet(events.NOTE_SEND_NOTE, (notes: any) => {
|
||||||
SendNuiMessage(
|
sendNotesEvent('setNotes', notes);
|
||||||
JSON.stringify({
|
|
||||||
app: 'NOTES',
|
|
||||||
method: 'setNotes',
|
|
||||||
data: notes,
|
|
||||||
})
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
RegisterNuiCallbackType(events.NOTE_ADD_NOTE);
|
RegisterNuiCallbackType(events.NOTE_ADD_NOTE);
|
||||||
on(`__cfx_nui:${events.NOTE_ADD_NOTE}`, (data: any) => {
|
on(`__cfx_nui:${events.NOTE_ADD_NOTE}`, (data: any) => {
|
||||||
const note = data;
|
emitNet(events.NOTE_ADD_NOTE, data);
|
||||||
emitNet(events.NOTE_ADD_NOTE, note);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
onNet(events.NOTE_SEND_NOTE_SUCCESS, () => {
|
onNet(events.NOTE_SEND_NOTE_SUCCESS, () => {
|
||||||
@@ -22,18 +16,22 @@ onNet(events.NOTE_SEND_NOTE_SUCCESS, () => {
|
|||||||
|
|
||||||
RegisterNuiCallbackType(events.NOTE_DELETE_NOTE);
|
RegisterNuiCallbackType(events.NOTE_DELETE_NOTE);
|
||||||
on(`__cfx_nui:${events.NOTE_DELETE_NOTE}`, (data: any) => {
|
on(`__cfx_nui:${events.NOTE_DELETE_NOTE}`, (data: any) => {
|
||||||
const noteId = data;
|
emitNet(events.NOTE_DELETE_NOTE, data);
|
||||||
emitNet(events.NOTE_DELETE_NOTE, noteId);
|
|
||||||
|
|
||||||
emitNet(events.NOTE_FETCH_ALL_NOTES);
|
emitNet(events.NOTE_FETCH_ALL_NOTES);
|
||||||
});
|
});
|
||||||
|
|
||||||
RegisterNuiCallbackType(events.NOTE_UPDATE_NOTE);
|
RegisterNuiCallbackType(events.NOTE_UPDATE_NOTE);
|
||||||
on(`__cfx_nui:${events.NOTE_UPDATE_NOTE}`, (data: any) => {
|
on(`__cfx_nui:${events.NOTE_UPDATE_NOTE}`, (data: any) => {
|
||||||
const note = data;
|
emitNet(events.NOTE_UPDATE_NOTE, data);
|
||||||
emitNet(events.NOTE_UPDATE_NOTE, note);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
onNet(events.NOTE_UPDATE_NOTE_SUCCESS, () => {
|
onNet(events.NOTE_UPDATE_NOTE_SUCCESS, () => {
|
||||||
emitNet(events.NOTE_FETCH_ALL_NOTES);
|
emitNet(events.NOTE_FETCH_ALL_NOTES);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
onNet(events.NOTE_ACTION_RESULT, (type: string) => {
|
||||||
|
console.log(type)
|
||||||
|
sendNotesEvent('setAlert', type)
|
||||||
|
})
|
||||||
@@ -13,8 +13,7 @@ async function fetchAllNotes(identifier: string): Promise<Note[]> {
|
|||||||
const query =
|
const query =
|
||||||
'SELECT * FROM npwd_notes WHERE identifier = ? ORDER BY id DESC';
|
'SELECT * FROM npwd_notes WHERE identifier = ? ORDER BY id DESC';
|
||||||
const [result] = await pool.query(query, [identifier]);
|
const [result] = await pool.query(query, [identifier]);
|
||||||
const notes = <Note[]>result;
|
return <Note[]>result;
|
||||||
return notes;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function deleteNote(noteId: number, identifier: string) {
|
async function deleteNote(noteId: number, identifier: string) {
|
||||||
@@ -30,42 +29,55 @@ async function updateNote(note: Note, identifier: string): Promise<any> {
|
|||||||
|
|
||||||
onNet(events.NOTE_ADD_NOTE, async (note: Note) => {
|
onNet(events.NOTE_ADD_NOTE, async (note: Note) => {
|
||||||
try {
|
try {
|
||||||
|
const pSource = (global as any).source
|
||||||
const _identifier = await useIdentifier();
|
const _identifier = await useIdentifier();
|
||||||
addNote(_identifier, note);
|
await addNote(_identifier, note);
|
||||||
emitNet(events.NOTE_SEND_NOTE_SUCCESS, getSource());
|
emitNet(events.NOTE_SEND_NOTE_SUCCESS, pSource);
|
||||||
|
emitNet(events.NOTE_ACTION_RESULT, pSource, 'NOTES_ADD_SUCCESS')
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('NOTES ERROR: ', error);
|
const pSource = (global as any).source
|
||||||
|
emitNet(events.NOTE_ACTION_RESULT, pSource, 'NOTES_ADD_FAILED')
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
onNet(events.NOTE_FETCH_ALL_NOTES, async () => {
|
onNet(events.NOTE_FETCH_ALL_NOTES, async () => {
|
||||||
try {
|
try {
|
||||||
const _source = (global as any).source;
|
const pSource = (global as any).source
|
||||||
const _identifier = await useIdentifier();
|
const _identifier = await useIdentifier();
|
||||||
const notes = await fetchAllNotes(_identifier);
|
const notes = await fetchAllNotes(_identifier);
|
||||||
emitNet(events.NOTE_SEND_NOTE, _source, notes);
|
emitNet(events.NOTE_SEND_NOTE, pSource, notes);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('NOTE ERROR: ', error);
|
console.dir(error)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
onNet(events.NOTE_DELETE_NOTE, async (noteId: NoteId) => {
|
onNet(events.NOTE_DELETE_NOTE, async (noteId: NoteId) => {
|
||||||
try {
|
try {
|
||||||
|
const pSource = (global as any).source;
|
||||||
const _identifier = await useIdentifier();
|
const _identifier = await useIdentifier();
|
||||||
const id = noteId.id;
|
await deleteNote(noteId.id, _identifier);
|
||||||
await deleteNote(id, _identifier);
|
|
||||||
|
emitNet(events.NOTE_ACTION_RESULT, pSource, 'NOTES_DELETE_SUCCESS')
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log('NOTE ERROR:', error);
|
const pSource = (global as any).source;
|
||||||
|
emitNet(events.NOTE_ACTION_RESULT, pSource, 'NOTES_DELETE_FAILED')
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
onNet(events.NOTE_UPDATE_NOTE, async (note: Note) => {
|
onNet(events.NOTE_UPDATE_NOTE, async (note: Note) => {
|
||||||
const _source = (global as any).source;
|
|
||||||
try {
|
try {
|
||||||
|
const pSource = (global as any).source;
|
||||||
const _identifier = await useIdentifier();
|
const _identifier = await useIdentifier();
|
||||||
updateNote(note, _identifier);
|
await updateNote(note, _identifier);
|
||||||
emitNet(events.NOTE_UPDATE_NOTE_SUCCESS, _source);
|
emitNet(events.NOTE_UPDATE_NOTE_SUCCESS, pSource);
|
||||||
|
emitNet(events.NOTE_ACTION_RESULT, pSource, 'NOTES_UPDATE_SUCCESS')
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
emitNet(events.NOTE_UPDATE_NOTE_FAILURE, _source);
|
const pSource = (global as any).source;
|
||||||
|
emitNet(events.NOTE_UPDATE_NOTE_FAILURE, pSource);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
export default {
|
export default {
|
||||||
TWITTER: 'TWITTER',
|
TWITTER: 'TWITTER',
|
||||||
MESSAGES: 'MESSAGES',
|
MESSAGES: 'MESSAGES',
|
||||||
|
NOTES: 'NOTES'
|
||||||
};
|
};
|
||||||
@@ -76,6 +76,8 @@ export default {
|
|||||||
NOTE_UPDATE_NOTE: 'phone:updateNote',
|
NOTE_UPDATE_NOTE: 'phone:updateNote',
|
||||||
NOTE_UPDATE_NOTE_SUCCESS: 'phone:updateNoteSuccess',
|
NOTE_UPDATE_NOTE_SUCCESS: 'phone:updateNoteSuccess',
|
||||||
NOTE_UPDATE_NOTE_FAILURE: 'phone:updateNoteFailure',
|
NOTE_UPDATE_NOTE_FAILURE: 'phone:updateNoteFailure',
|
||||||
|
NOTE_ACTION_RESULT: 'phone:notesActionResult',
|
||||||
|
|
||||||
|
|
||||||
// DO NOT CHANGE WHATS BELOW, PLEASE - CHIP
|
// DO NOT CHANGE WHATS BELOW, PLEASE - CHIP
|
||||||
OPEN_APP_CONTACTS: 'phone:app:CONTACTS',
|
OPEN_APP_CONTACTS: 'phone:app:CONTACTS',
|
||||||
|
|||||||
@@ -17,3 +17,7 @@ export function sendTwitterMessage(method: string, data: any = {}) {
|
|||||||
export function sendMessageEvent(method: string, data: any = {}) {
|
export function sendMessageEvent(method: string, data: any = {}) {
|
||||||
return sendMessage(apps.MESSAGES, method, data);
|
return sendMessage(apps.MESSAGES, method, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function sendNotesEvent(method: string, data: any = {}) {
|
||||||
|
return sendMessage(apps.NOTES, method, data);
|
||||||
|
}
|
||||||
Reference in new issue
Block a user