[feature-75] fix some sonarcloud issues + other potentials issues + add logs

This commit is contained in:
MathieuG-P
2024-10-17 13:31:41 +02:00
parent b10900618a
commit 00d6d7de30
2 changed files with 18 additions and 12 deletions
@@ -107,13 +107,12 @@ export function MapsPlaylistsPanel({ version, isActive }: Props) {
const handleFileDrop = async (files: FileList) => {
const zipMimeTypes = ["application/zip", "application/zip-compressed", "application/x-zip-compressed"];
const paths: string[] = [];
for (let i = 0; i < files.length; ++i) {
const file = files[i];
const paths: string[] = Array.from(files).reduce((acc, file) => {
if (zipMimeTypes.includes(file.type)) {
paths.push(window.electron.webUtils.getPathForFile(file));
acc.push(window.electron.webUtils.getPathForFile(file));
}
}
return acc;
}, []);
if (paths.length === 0) {
notifications.notifyError({