fixing lint errors

This commit is contained in:
Roland Osborne 2023-04-14 17:11:05 -07:00
parent 05cb4e89df
commit a7d2d379f8
5 changed files with 9 additions and 21 deletions

View File

@ -1,4 +1,4 @@
import { useEffect, useContext, useState, useRef } from 'react';
import { useState, useRef } from 'react';
import { createWebsocket } from 'api/fetchUtil';
import { addContactRing } from 'api/addContactRing';
import { addCall } from 'api/addCall';
@ -377,6 +377,7 @@ export function useRingContext() {
updateState({ callStatus: null });
}
let index = 0;
const { id, keepAlive, callerToken, calleeToken, iceUrl, iceUsername, icePassword } = call;
try {
await addContactRing(contactNode, contactToken, { index, callId: id, calleeToken, iceUrl, iceUsername, icePassword });
@ -392,7 +393,6 @@ export function useRingContext() {
console.log(err);
}
}, keepAlive * 1000);
let index = 0;
const ringInterval = setInterval(async () => {
try {
if (index > RING_COUNT) {
@ -462,18 +462,3 @@ export function useRingContext() {
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();
}

View File

@ -14,7 +14,7 @@ import { Account } from './account/Account';
import { Welcome } from './welcome/Welcome';
import { BottomNav } from './bottomNav/BottomNav';
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";
export function Session() {
@ -43,6 +43,7 @@ export function Session() {
);
}
setRinging(incoming);
// eslint-disable-next-line
}, [state.ringing]);
useEffect(() => {
@ -327,7 +328,7 @@ export function Session() {
</div>
</RingingWrapper>
</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>
{ !state.remoteVideo && (
<Logo url={state.callLogo} width={256} height={256} radius={8} />

View File

@ -26,7 +26,7 @@ export function Cards({ closeCards, openContact, openChannel, openListing }) {
const call = async (contact) => {
try {
const id = await actions.call(contact);
await actions.call(contact);
}
catch (err) {
console.log(err);
@ -40,6 +40,7 @@ export function Cards({ closeCards, openContact, openChannel, openListing }) {
return (
<CardsWrapper>
{ modalContext }
<div className="search">
{ !state.sorted && (
<div className="unsorted" onClick={() => actions.setSort(true)}>

View File

@ -144,7 +144,7 @@ export function useCards() {
},
call: async (contact) => {
const { cardId, node, guid, token } = contact;
await ring.actions.call(contact.cardId, node, `${guid}.${token}`);
await ring.actions.call(cardId, node, `${guid}.${token}`);
},
};

View File

@ -76,6 +76,7 @@ export function useSession() {
const { callStatus, localStream, localVideo, localAudio, remoteStream, remoteVideo, remoteAudio } = ring.state;
updateState({ ringing, callStatus, callLogo, localStream, localVideo, localAudio, remoteStream, remoteVideo, remoteAudio });
// eslint-disable-next-line
}, [ring.state]);
useEffect(() => {