mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 03:29:16 +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 { 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();
|
||||
}
|
||||
|
||||
|
@ -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} />
|
||||
|
@ -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)}>
|
||||
|
@ -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}`);
|
||||
},
|
||||
};
|
||||
|
||||
|
@ -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(() => {
|
||||
|
Loading…
Reference in New Issue
Block a user