Merge branch 'main' into fix-keyboard-navigate-issue
This commit is contained in:
commit
896cdd98af
3 changed files with 6 additions and 8 deletions
|
@ -34,7 +34,6 @@ import { t } from 'i18next';
|
|||
import memoize from 'memoize-one';
|
||||
import { LocationTagData } from 'types/entity';
|
||||
import { FILE_TYPE } from 'constants/file';
|
||||
import { addLogLine } from '@ente/shared/logging';
|
||||
|
||||
interface Iprops {
|
||||
isOpen: boolean;
|
||||
|
@ -70,10 +69,7 @@ export default function SearchInput(props: Iprops) {
|
|||
}, []);
|
||||
|
||||
async function refreshDefaultOptions() {
|
||||
const t = Date.now();
|
||||
addLogLine('refreshDefaultOptions called');
|
||||
const defaultOptions = await getDefaultOptions(props.files);
|
||||
addLogLine(`refreshDefaultOptions end time: ${Date.now() - t}ms`);
|
||||
setDefaultOptions(defaultOptions);
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,11 @@ export async function getDuplicates(
|
|||
collectionNameMap: Map<number, string>
|
||||
) {
|
||||
try {
|
||||
const dupes = await fetchDuplicateFileIDs();
|
||||
const ascDupes = await fetchDuplicateFileIDs();
|
||||
|
||||
const descSortedDupes = ascDupes.sort((firstDupe, secondDupe) => {
|
||||
return secondDupe.size - firstDupe.size;
|
||||
});
|
||||
|
||||
const fileMap = new Map<number, EnteFile>();
|
||||
for (const file of files) {
|
||||
|
@ -35,7 +39,7 @@ export async function getDuplicates(
|
|||
|
||||
let result: Duplicate[] = [];
|
||||
|
||||
for (const dupe of dupes) {
|
||||
for (const dupe of descSortedDupes) {
|
||||
let duplicateFiles: EnteFile[] = [];
|
||||
for (const fileID of dupe.fileIDs) {
|
||||
if (fileMap.has(fileID)) {
|
||||
|
|
|
@ -174,9 +174,7 @@ function getYearSuggestion(searchPhrase: string): Suggestion[] {
|
|||
|
||||
export async function getAllPeopleSuggestion(): Promise<Array<Suggestion>> {
|
||||
try {
|
||||
addLogLine('getAllPeopleSuggestion called');
|
||||
const people = await getAllPeople(200);
|
||||
addLogLine(`found people: ${people?.length ?? 0}`);
|
||||
return people.map((person) => ({
|
||||
label: person.name,
|
||||
type: SuggestionType.PERSON,
|
||||
|
|
Loading…
Add table
Reference in a new issue