fixed memory leak

This commit is contained in:
Daniel Shleifman
2021-05-27 18:47:39 +03:00
parent bd492b4bf8
commit 981f668da5
2 changed files with 6 additions and 5 deletions

View File

@@ -6,7 +6,7 @@ import { NoImageIcon } from 'icons'
import { getPeerString, humanizeSize } from 'utils/Utils'
import { viewedHost } from 'utils/Hosts'
import { CopyToClipboard } from 'react-copy-to-clipboard'
import { useState } from 'react'
import { useEffect, useState } from 'react'
import { useUpdateCache, useCreateCacheMap } from './customHooks'
@@ -116,7 +116,9 @@ export default function DialogTorrentDetailsContent({ closeDialog, torrent }) {
} = torrent
const cache = useUpdateCache(hash)
const cacheMap = useCreateCacheMap(cache, () => setIsLoading(false))
const cacheMap = useCreateCacheMap(cache)
useEffect(() => setIsLoading(false), [cacheMap])
const { Capacity, PiecesCount, PiecesLength } = cache