mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
feat(calling/client|server): partical functions for calling
Should probably reuse data
This commit is contained in:
1 parent
c12b0ba126
commit
77c7cc303e
8 files changed
+133
-56
No files matched your search
+24
-3
@@ -28,6 +28,8 @@ import { settingsState } from './apps/settings/hooks/useSettings';
|
||||
|
||||
import config from './config/default.json';
|
||||
import { useRecoilState } from 'recoil';
|
||||
import { useCallService } from './modal/hooks/useCallService';
|
||||
import { useModal } from './modal/hooks/useModal';
|
||||
|
||||
// Inject mock data when in development env.
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
@@ -52,6 +54,24 @@ if (process.env.NODE_ENV === 'development') {
|
||||
);
|
||||
}, 1000);
|
||||
|
||||
setTimeout(() => {
|
||||
window.dispatchEvent(
|
||||
new MessageEvent('message', {
|
||||
data: {
|
||||
app: 'CALL',
|
||||
method: 'setCaller',
|
||||
data: {
|
||||
accepted: false,
|
||||
transmitter: false,
|
||||
caller: 'Chip',
|
||||
target: 'Christian',
|
||||
phone_number: '860-4504',
|
||||
}
|
||||
},
|
||||
})
|
||||
);
|
||||
}, 1000);
|
||||
|
||||
setTimeout(() => {
|
||||
window.dispatchEvent(
|
||||
new MessageEvent('message', {
|
||||
@@ -258,6 +278,9 @@ function Phone() {
|
||||
useMessagesService();
|
||||
useNotesService();
|
||||
usePhotoService();
|
||||
useCallService();
|
||||
|
||||
const { modal } = useModal(); // the calling modal
|
||||
|
||||
const [settings] = useRecoilState(settingsState);
|
||||
|
||||
@@ -267,8 +290,6 @@ function Phone() {
|
||||
|
||||
const currentTheme = () => createMuiTheme(config.themes[settings.theme]);
|
||||
|
||||
const calling = false;
|
||||
|
||||
document.onkeyup = function (data) {
|
||||
if (data.which === 27) {
|
||||
Nui.send('phone:close');
|
||||
@@ -303,7 +324,7 @@ function Phone() {
|
||||
]}
|
||||
/>
|
||||
<div className='PhoneAppContainer'>
|
||||
{calling ? (
|
||||
{modal ? (
|
||||
<CallModal />
|
||||
) : (
|
||||
<>
|
||||
|
||||
Reference in new issue
Block a user