Skip to content
This repository has been archived by the owner on Aug 19, 2024. It is now read-only.

Commit

Permalink
Remove duplicate search results
Browse files Browse the repository at this point in the history
  • Loading branch information
egbertbouman committed Aug 1, 2024
1 parent b820bfd commit b2fa912
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/tribler/ui/src/pages/Search/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useEffect, useState } from "react";
import { triblerService } from "@/services/tribler.service";
import { Torrent } from "@/models/torrent.model";
import { ColumnDef } from "@tanstack/react-table";
import { categoryIcon, formatBytes, formatTimeAgo, getMagnetLink } from "@/lib/utils";
import { categoryIcon, filterDuplicates, formatBytes, formatTimeAgo, getMagnetLink } from "@/lib/utils";
import SaveAs from "@/dialogs/SaveAs";
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
import { useSearchParams } from "react-router-dom";
Expand Down Expand Up @@ -69,7 +69,8 @@ export default function Search() {
useEffect(() => {
const searchTorrents = async () => {
if (!query) return;
setTorrents((await triblerService.searchTorrentsLocal(query, true)));
const localResults = await triblerService.searchTorrentsLocal(query, true);
setTorrents(filterDuplicates(localResults, 'infohash'));
const remoteQuery = await triblerService.searchTorrentsRemote(query, true);
setRequest(remoteQuery.request_uuid);
}
Expand Down

0 comments on commit b2fa912

Please sign in to comment.