diff --git a/client/src/javascript/components/torrent-list/TorrentListRow.tsx b/client/src/javascript/components/torrent-list/TorrentListRow.tsx index 05efbbe4..4eb4e77b 100644 --- a/client/src/javascript/components/torrent-list/TorrentListRow.tsx +++ b/client/src/javascript/components/torrent-list/TorrentListRow.tsx @@ -55,9 +55,9 @@ interface TorrentListRowProps { style: CSSProperties; } -const TorrentListRow: FC = observer((props: TorrentListRowProps) => { - const {hash, style} = props; +const TorrentListRow: FC = observer(({hash, style}: TorrentListRowProps) => { const [rowLocation, setRowLocation] = useState(0); + const shouldDisplayTorrentDetails = useRef(false); const rowRef = useRef(null); const isCondensed = SettingStore.floodSettings.torrentListViewSize === 'condensed'; @@ -83,10 +83,17 @@ const TorrentListRow: FC = observer((props: TorrentListRowP ); const onTouchStartHooked = (e: TouchEvent) => { - if (TorrentStore.selectedTorrents.includes(hash)) { + if (!TorrentStore.selectedTorrents.includes(hash)) { + selectTorrent(hash, e); + } + + if (shouldDisplayTorrentDetails.current) { displayTorrentDetails(hash); } else { - selectTorrent(hash, e); + shouldDisplayTorrentDetails.current = true; + setTimeout(() => { + shouldDisplayTorrentDetails.current = false; + }, 200); } setRowLocation(rowRef.current?.getBoundingClientRect().top || 0);