From a7d2d379f849e32df23239c9ea44d2f47daee9e2 Mon Sep 17 00:00:00 2001 From: Roland Osborne Date: Fri, 14 Apr 2023 17:11:05 -0700 Subject: [PATCH] fixing lint errors --- net/web/src/context/useRingContext.hook.js | 19 ++----------------- net/web/src/session/Session.jsx | 5 +++-- net/web/src/session/cards/Cards.jsx | 3 ++- net/web/src/session/cards/useCards.hook.js | 2 +- net/web/src/session/useSession.hook.js | 1 + 5 files changed, 9 insertions(+), 21 deletions(-) diff --git a/net/web/src/context/useRingContext.hook.js b/net/web/src/context/useRingContext.hook.js index 7f8e17d6..74ec1290 100644 --- a/net/web/src/context/useRingContext.hook.js +++ b/net/web/src/context/useRingContext.hook.js @@ -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(); - } - diff --git a/net/web/src/session/Session.jsx b/net/web/src/session/Session.jsx index 5caacf12..aa18b25a 100644 --- a/net/web/src/session/Session.jsx +++ b/net/web/src/session/Session.jsx @@ -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() { - + { !state.remoteVideo && ( diff --git a/net/web/src/session/cards/Cards.jsx b/net/web/src/session/cards/Cards.jsx index 6794425d..508cc586 100644 --- a/net/web/src/session/cards/Cards.jsx +++ b/net/web/src/session/cards/Cards.jsx @@ -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 ( + { modalContext }
{ !state.sorted && (
actions.setSort(true)}> diff --git a/net/web/src/session/cards/useCards.hook.js b/net/web/src/session/cards/useCards.hook.js index 703c8c84..33ce772c 100644 --- a/net/web/src/session/cards/useCards.hook.js +++ b/net/web/src/session/cards/useCards.hook.js @@ -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}`); }, }; diff --git a/net/web/src/session/useSession.hook.js b/net/web/src/session/useSession.hook.js index 89133777..6d55b5a5 100644 --- a/net/web/src/session/useSession.hook.js +++ b/net/web/src/session/useSession.hook.js @@ -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(() => {