mirror of
https://github.com/balzack/databag.git
synced 2025-02-14 20:49:16 +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 }) {
|
export function VideoFile({ url, onPosition }) {
|
||||||
|
|
||||||
const [state, setState] = useState({ width: 0, height: 0 });
|
const [state, setState] = useState({ width: 0, height: 0 });
|
||||||
const [playing, setPlaying] = useState(false);
|
|
||||||
const player = useRef(null);
|
const player = useRef(null);
|
||||||
const seek = useRef(0);
|
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 { Progress, Modal, Spin } from 'antd';
|
||||||
import ReactResizeDetector from 'react-resize-detector';
|
import ReactResizeDetector from 'react-resize-detector';
|
||||||
import { PlayCircleOutlined, MinusCircleOutlined, SoundOutlined } from '@ant-design/icons';
|
import { PlayCircleOutlined, MinusCircleOutlined, SoundOutlined } from '@ant-design/icons';
|
||||||
@ -57,7 +57,7 @@ export function AudioAsset({ asset }) {
|
|||||||
{ state.loading && !state.error && (
|
{ state.loading && !state.error && (
|
||||||
<div class="loading">
|
<div class="loading">
|
||||||
<Spin size="large" delay={250} />
|
<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} />
|
<Progress percent={Math.floor(100 * state.block / state.total)} size="small" showInfo={false} trailColor={Colors.white} strokeColor={Colors.background} />
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
@ -25,7 +25,7 @@ export function useAudioAsset(asset) {
|
|||||||
try {
|
try {
|
||||||
const view = index.current;
|
const view = index.current;
|
||||||
updateState({ active: true, ready: false, error: false, loading: true, url: null });
|
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);
|
const url = URL.createObjectURL(blob);
|
||||||
revoke.current = url;
|
revoke.current = url;
|
||||||
updateState({ loading: false, url });
|
updateState({ loading: false, url });
|
||||||
|
@ -43,7 +43,7 @@ export function ImageAsset({ asset }) {
|
|||||||
{ !state.error && (
|
{ !state.error && (
|
||||||
<div class="loading">
|
<div class="loading">
|
||||||
<Spin size="large" delay={250} />
|
<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} />
|
<Progress percent={Math.floor(100 * state.block / state.total)} size="small" showInfo={false} trailColor={Colors.white} strokeColor={Colors.background} />
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
@ -26,7 +26,7 @@ export function useImageAsset(asset) {
|
|||||||
try {
|
try {
|
||||||
const view = index.current;
|
const view = index.current;
|
||||||
updateState({ popout: true, width, height, error: false, loading: true, url: null });
|
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);
|
const url = URL.createObjectURL(blob);
|
||||||
updateState({ loading: false, url });
|
updateState({ loading: false, url });
|
||||||
revoke.current = url;
|
revoke.current = url;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { useState, useEffect } from 'react';
|
import { useState, useEffect } from 'react';
|
||||||
import { checkResponse, fetchWithTimeout } from 'api/fetchUtil';
|
import { fetchWithTimeout } from 'api/fetchUtil';
|
||||||
import { decryptBlock } from 'context/sealUtil';
|
import { decryptBlock } from 'context/sealUtil';
|
||||||
|
|
||||||
export function useTopicItem(topic, contentKey) {
|
export function useTopicItem(topic, contentKey) {
|
||||||
@ -86,6 +86,7 @@ export function useTopicItem(topic, contentKey) {
|
|||||||
});
|
});
|
||||||
updateState({ assets });
|
updateState({ assets });
|
||||||
}
|
}
|
||||||
|
// eslint-disable-next-line
|
||||||
}, [topic.assets]);
|
}, [topic.assets]);
|
||||||
|
|
||||||
const actions = {
|
const actions = {
|
||||||
|
@ -52,7 +52,7 @@ export function VideoAsset({ asset }) {
|
|||||||
{ !state.error && (
|
{ !state.error && (
|
||||||
<div class="loading">
|
<div class="loading">
|
||||||
<Spin size="large" delay={250} />
|
<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} />
|
<Progress percent={Math.floor(100 * state.block / state.total)} size="small" showInfo={false} trailColor={Colors.white} strokeColor={Colors.background} />
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
@ -28,7 +28,7 @@ export function useVideoAsset(asset) {
|
|||||||
try {
|
try {
|
||||||
const view = index.current;
|
const view = index.current;
|
||||||
updateState({ active: true, width, height, error: false, loaded: false, loading: true, url: null });
|
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);
|
const url = URL.createObjectURL(blob);
|
||||||
revoke.current = url;
|
revoke.current = url;
|
||||||
updateState({ url, loading: false });
|
updateState({ url, loading: false });
|
||||||
|
@ -145,7 +145,7 @@ export function useConversation(cardId, channelId) {
|
|||||||
|
|
||||||
let group = '';
|
let group = '';
|
||||||
let clickable = [];
|
let clickable = [];
|
||||||
const words = text == [] ? '' : DOMPurify.sanitize(text).split(' ');
|
const words = text === [] ? '' : DOMPurify.sanitize(text).split(' ');
|
||||||
words.forEach((word, index) => {
|
words.forEach((word, index) => {
|
||||||
if (!!urlPattern.test(word)) {
|
if (!!urlPattern.test(word)) {
|
||||||
clickable.push(<span key={index}>{ group }</span>);
|
clickable.push(<span key={index}>{ group }</span>);
|
||||||
|
Loading…
Reference in New Issue
Block a user