mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 11:39:17 +00:00
fixing lint errors
This commit is contained in:
parent
05cb4e89df
commit
a7d2d379f8
@ -1,4 +1,4 @@
|
|||||||
import { useEffect, useContext, useState, useRef } from 'react';
|
import { useState, useRef } from 'react';
|
||||||
import { createWebsocket } from 'api/fetchUtil';
|
import { createWebsocket } from 'api/fetchUtil';
|
||||||
import { addContactRing } from 'api/addContactRing';
|
import { addContactRing } from 'api/addContactRing';
|
||||||
import { addCall } from 'api/addCall';
|
import { addCall } from 'api/addCall';
|
||||||
@ -377,6 +377,7 @@ export function useRingContext() {
|
|||||||
updateState({ callStatus: null });
|
updateState({ callStatus: null });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let index = 0;
|
||||||
const { id, keepAlive, callerToken, calleeToken, iceUrl, iceUsername, icePassword } = call;
|
const { id, keepAlive, callerToken, calleeToken, iceUrl, iceUsername, icePassword } = call;
|
||||||
try {
|
try {
|
||||||
await addContactRing(contactNode, contactToken, { index, callId: id, calleeToken, iceUrl, iceUsername, icePassword });
|
await addContactRing(contactNode, contactToken, { index, callId: id, calleeToken, iceUrl, iceUsername, icePassword });
|
||||||
@ -392,7 +393,6 @@ export function useRingContext() {
|
|||||||
console.log(err);
|
console.log(err);
|
||||||
}
|
}
|
||||||
}, keepAlive * 1000);
|
}, keepAlive * 1000);
|
||||||
let index = 0;
|
|
||||||
const ringInterval = setInterval(async () => {
|
const ringInterval = setInterval(async () => {
|
||||||
try {
|
try {
|
||||||
if (index > RING_COUNT) {
|
if (index > RING_COUNT) {
|
||||||
@ -462,18 +462,3 @@ export function useRingContext() {
|
|||||||
return { state, actions }
|
return { state, actions }
|
||||||
}
|
}
|
||||||
|
|
||||||
function whiteNoise() {
|
|
||||||
const canvas = Object.assign(document.createElement("canvas"), {width: 320, height: 240});
|
|
||||||
const ctx = canvas.getContext('2d');
|
|
||||||
ctx.fillRect(0, 0, 320, 240);
|
|
||||||
const p = ctx.getImageData(0, 0, 320, 240);
|
|
||||||
requestAnimationFrame(function draw(){
|
|
||||||
for (var i = 0; i < p.data.length; i++) {
|
|
||||||
p.data[i++] = p.data[i++] = p.data[i++] = Math.random() * 255;
|
|
||||||
}
|
|
||||||
ctx.putImageData(p, 0, 0);
|
|
||||||
requestAnimationFrame(draw);
|
|
||||||
});
|
|
||||||
return canvas.captureStream();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
@ -14,7 +14,7 @@ import { Account } from './account/Account';
|
|||||||
import { Welcome } from './welcome/Welcome';
|
import { Welcome } from './welcome/Welcome';
|
||||||
import { BottomNav } from './bottomNav/BottomNav';
|
import { BottomNav } from './bottomNav/BottomNav';
|
||||||
import { Logo } from 'logo/Logo';
|
import { Logo } from 'logo/Logo';
|
||||||
import { EyeInvisibleOutlined, CloseOutlined, PhoneOutlined } from '@ant-design/icons';
|
import { EyeInvisibleOutlined, PhoneOutlined } from '@ant-design/icons';
|
||||||
import { IoVideocamOffOutline, IoVideocamOutline, IoMicOffOutline, IoMicOutline, IoCallOutline } from "react-icons/io5";
|
import { IoVideocamOffOutline, IoVideocamOutline, IoMicOffOutline, IoMicOutline, IoCallOutline } from "react-icons/io5";
|
||||||
|
|
||||||
export function Session() {
|
export function Session() {
|
||||||
@ -43,6 +43,7 @@ export function Session() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
setRinging(incoming);
|
setRinging(incoming);
|
||||||
|
// eslint-disable-next-line
|
||||||
}, [state.ringing]);
|
}, [state.ringing]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -327,7 +328,7 @@ export function Session() {
|
|||||||
</div>
|
</div>
|
||||||
</RingingWrapper>
|
</RingingWrapper>
|
||||||
</Modal>
|
</Modal>
|
||||||
<Modal centered visible={state.callStatus} footer={null} closable={false} width={callModal.width} height={callModal.height} bodyStyle={{ paddingBottom: 0, paddingTop: 6, paddingLeft: 6, paddingRight: 6, paddingBottom: 6 }}>
|
<Modal centered visible={state.callStatus} footer={null} closable={false} width={callModal.width} height={callModal.height} bodyStyle={{ paddingBottom: 0, paddingTop: 6, paddingLeft: 6, paddingRight: 6 }}>
|
||||||
<CallingWrapper>
|
<CallingWrapper>
|
||||||
{ !state.remoteVideo && (
|
{ !state.remoteVideo && (
|
||||||
<Logo url={state.callLogo} width={256} height={256} radius={8} />
|
<Logo url={state.callLogo} width={256} height={256} radius={8} />
|
||||||
|
@ -26,7 +26,7 @@ export function Cards({ closeCards, openContact, openChannel, openListing }) {
|
|||||||
|
|
||||||
const call = async (contact) => {
|
const call = async (contact) => {
|
||||||
try {
|
try {
|
||||||
const id = await actions.call(contact);
|
await actions.call(contact);
|
||||||
}
|
}
|
||||||
catch (err) {
|
catch (err) {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
@ -40,6 +40,7 @@ export function Cards({ closeCards, openContact, openChannel, openListing }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<CardsWrapper>
|
<CardsWrapper>
|
||||||
|
{ modalContext }
|
||||||
<div className="search">
|
<div className="search">
|
||||||
{ !state.sorted && (
|
{ !state.sorted && (
|
||||||
<div className="unsorted" onClick={() => actions.setSort(true)}>
|
<div className="unsorted" onClick={() => actions.setSort(true)}>
|
||||||
|
@ -144,7 +144,7 @@ export function useCards() {
|
|||||||
},
|
},
|
||||||
call: async (contact) => {
|
call: async (contact) => {
|
||||||
const { cardId, node, guid, token } = contact;
|
const { cardId, node, guid, token } = contact;
|
||||||
await ring.actions.call(contact.cardId, node, `${guid}.${token}`);
|
await ring.actions.call(cardId, node, `${guid}.${token}`);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -76,6 +76,7 @@ export function useSession() {
|
|||||||
|
|
||||||
const { callStatus, localStream, localVideo, localAudio, remoteStream, remoteVideo, remoteAudio } = ring.state;
|
const { callStatus, localStream, localVideo, localAudio, remoteStream, remoteVideo, remoteAudio } = ring.state;
|
||||||
updateState({ ringing, callStatus, callLogo, localStream, localVideo, localAudio, remoteStream, remoteVideo, remoteAudio });
|
updateState({ ringing, callStatus, callLogo, localStream, localVideo, localAudio, remoteStream, remoteVideo, remoteAudio });
|
||||||
|
// eslint-disable-next-line
|
||||||
}, [ring.state]);
|
}, [ring.state]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
Loading…
Reference in New Issue
Block a user