From ab7468f0284bcd6e8131d0250c54a601273fbe0f Mon Sep 17 00:00:00 2001 From: Maurice Date: Sun, 29 Nov 2026 18:39:54 +0100 Subject: [PATCH] fix(ci): the file error helper no longer shadows the modal's own errorText The new switch over the file errors took the name of the component's local errorText, so the local constant was read before its declaration (TS2448, the import tests and an unused-var warning). It is fileErrorText now. --- client/src/components/Collections/ImportCollectionModal.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/components/Collections/ImportCollectionModal.tsx b/client/src/components/Collections/ImportCollectionModal.tsx index f88ecfa6e..2cfc3df23 100644 --- a/client/src/components/Collections/ImportCollectionModal.tsx +++ b/client/src/components/Collections/ImportCollectionModal.tsx @@ -36,7 +36,7 @@ interface ImportCollectionModalProps { } /** The words for each way a file can fail; a switch, so a new way does not build without its words. */ -function errorText(error: CollectionFileError, t: TranslationFn, count: number): string { +function fileErrorText(error: CollectionFileError, t: TranslationFn, count: number): string { switch (error) { case 'too-large': return t('collections.file.errorTooLarge') @@ -278,7 +278,7 @@ export default function ImportCollectionModal({ const errorText = error === 'failed' ? (failedMessage ?? t('common.error')) - : error ? errorText(error, t, MAX_COLLECTION_FILE_PLACES) : null + : error ? fileErrorText(error, t, MAX_COLLECTION_FILE_PLACES) : null // A GPX of nothing but a track would make an empty list, which is never what was meant. const nothingToImport = (!!leftovers || !!map) && !!file && (map ? picked.size === 0 : file.places.length === 0)