fix compile warnings

This commit is contained in:
Roland Osborne 2023-05-05 16:16:52 -07:00
parent c3cae25fe1
commit 0fa341796f
9 changed files with 10 additions and 10 deletions

View File

@ -6,7 +6,6 @@ import { VideoFileWrapper } from './VideoFile.styled';
export function VideoFile({ url, onPosition }) {
const [state, setState] = useState({ width: 0, height: 0 });
const [playing, setPlaying] = useState(false);
const player = useRef(null);
const seek = useRef(0);

View File

@ -1,4 +1,4 @@
import React, { useEffect, useState, useRef } from 'react';
import React, { useState, useRef } from 'react';
import { Progress, Modal, Spin } from 'antd';
import ReactResizeDetector from 'react-resize-detector';
import { PlayCircleOutlined, MinusCircleOutlined, SoundOutlined } from '@ant-design/icons';
@ -57,7 +57,7 @@ export function AudioAsset({ asset }) {
{ state.loading && !state.error && (
<div class="loading">
<Spin size="large" delay={250} />
{ state.total != 0 && (
{ state.total !== 0 && (
<Progress percent={Math.floor(100 * state.block / state.total)} size="small" showInfo={false} trailColor={Colors.white} strokeColor={Colors.background} />
)}
</div>

View File

@ -25,7 +25,7 @@ export function useAudioAsset(asset) {
try {
const view = index.current;
updateState({ active: true, ready: false, error: false, loading: true, url: null });
const blob = await asset.getDecryptedBlob(() => view != index.current, (block, total) => updateState({ block, total }));
const blob = await asset.getDecryptedBlob(() => view !== index.current, (block, total) => updateState({ block, total }));
const url = URL.createObjectURL(blob);
revoke.current = url;
updateState({ loading: false, url });

View File

@ -43,7 +43,7 @@ export function ImageAsset({ asset }) {
{ !state.error && (
<div class="loading">
<Spin size="large" delay={250} />
{ state.total != 0 && (
{ state.total !== 0 && (
<Progress percent={Math.floor(100 * state.block / state.total)} size="small" showInfo={false} trailColor={Colors.white} strokeColor={Colors.background} />
)}
</div>

View File

@ -26,7 +26,7 @@ export function useImageAsset(asset) {
try {
const view = index.current;
updateState({ popout: true, width, height, error: false, loading: true, url: null });
const blob = await asset.getDecryptedBlob(() => view != index.current, (block, total) => updateState({ block, total }));
const blob = await asset.getDecryptedBlob(() => view !== index.current, (block, total) => updateState({ block, total }));
const url = URL.createObjectURL(blob);
updateState({ loading: false, url });
revoke.current = url;

View File

@ -1,5 +1,5 @@
import { useState, useEffect } from 'react';
import { checkResponse, fetchWithTimeout } from 'api/fetchUtil';
import { fetchWithTimeout } from 'api/fetchUtil';
import { decryptBlock } from 'context/sealUtil';
export function useTopicItem(topic, contentKey) {
@ -86,6 +86,7 @@ export function useTopicItem(topic, contentKey) {
});
updateState({ assets });
}
// eslint-disable-next-line
}, [topic.assets]);
const actions = {

View File

@ -52,7 +52,7 @@ export function VideoAsset({ asset }) {
{ !state.error && (
<div class="loading">
<Spin size="large" delay={250} />
{ state.total != 0 && (
{ state.total !== 0 && (
<Progress percent={Math.floor(100 * state.block / state.total)} size="small" showInfo={false} trailColor={Colors.white} strokeColor={Colors.background} />
)}
</div>

View File

@ -28,7 +28,7 @@ export function useVideoAsset(asset) {
try {
const view = index.current;
updateState({ active: true, width, height, error: false, loaded: false, loading: true, url: null });
const blob = await asset.getDecryptedBlob(() => view != index.current, (block, total) => updateState({ block, total }));
const blob = await asset.getDecryptedBlob(() => view !== index.current, (block, total) => updateState({ block, total }));
const url = URL.createObjectURL(blob);
revoke.current = url;
updateState({ url, loading: false });

View File

@ -145,7 +145,7 @@ export function useConversation(cardId, channelId) {
let group = '';
let clickable = [];
const words = text == [] ? '' : DOMPurify.sanitize(text).split(' ');
const words = text === [] ? '' : DOMPurify.sanitize(text).split(' ');
words.forEach((word, index) => {
if (!!urlPattern.test(word)) {
clickable.push(<span key={index}>{ group }</span>);