mirror of
https://github.com/balzack/databag.git
synced 2025-02-14 12:39:17 +00:00
fix compile warnings
This commit is contained in:
parent
c3cae25fe1
commit
0fa341796f
@ -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);
|
||||
|
||||
|
@ -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>
|
||||
|
@ -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 });
|
||||
|
@ -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>
|
||||
|
@ -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;
|
||||
|
@ -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 = {
|
||||
|
@ -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>
|
||||
|
@ -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 });
|
||||
|
@ -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>);
|
||||
|
Loading…
Reference in New Issue
Block a user