From ea261dec1cfacc8f2e38589c79760f557b142bd7 Mon Sep 17 00:00:00 2001 From: Daria Terekhova Date: Thu, 28 Nov 2024 21:03:54 +0200 Subject: [PATCH] Lint fix --- src/components/layers-panel/insert-panel/insert-panel.tsx | 4 ++-- src/components/upload-panel/upload-panel-item.tsx | 2 +- src/components/upload-panel/upload-panel.tsx | 6 +++--- src/redux/slices/layer-names-slice.ts | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/layers-panel/insert-panel/insert-panel.tsx b/src/components/layers-panel/insert-panel/insert-panel.tsx index e8c2791a..21b956da 100644 --- a/src/components/layers-panel/insert-panel/insert-panel.tsx +++ b/src/components/layers-panel/insert-panel/insert-panel.tsx @@ -1,4 +1,4 @@ -import { type ChangeEvent, useEffect, useState } from "react"; +import { type useEffect, useState } from "react"; import styled from "styled-components"; import { @@ -119,7 +119,7 @@ export const InsertPanel = ({ const layerNames = useAppSelector(selectLayerNames); const dispatch = useAppDispatch(); - const getNewLayerUrl = () => getLayerUrl(url) + const getNewLayerUrl = () => getLayerUrl(url); const validateFields = (): void => { let isFormValid = true; diff --git a/src/components/upload-panel/upload-panel-item.tsx b/src/components/upload-panel/upload-panel-item.tsx index c4d02d5f..574cd51b 100644 --- a/src/components/upload-panel/upload-panel-item.tsx +++ b/src/components/upload-panel/upload-panel-item.tsx @@ -56,7 +56,7 @@ export const UploadPanelItem = ({ {title && {title}} {children} - {(onConfirm || onCancel) && + {(onConfirm ?? onCancel) && {onCancel && = { url: file.name, }; - onFileUploaded({ fileContent: event?.target?.result, info }); + await onFileUploaded({ fileContent: event?.target?.result, info }); }; if (fileType === FileType.binary) { reader.readAsArrayBuffer(file); @@ -114,7 +114,7 @@ export const UploadPanel = ({ e.stopPropagation(); setDragActive(false); if (e.dataTransfer.files?.[0]) { - setFileUploaded(e.dataTransfer.files[0].name) + setFileUploaded(e.dataTransfer.files[0].name); readFile(e.dataTransfer.files).catch(() => { console.error("Read uploaded file operation error"); }); @@ -126,7 +126,7 @@ export const UploadPanel = ({ ) { e.preventDefault(); if (e.target.files?.[0]) { - setFileUploaded(e.target.files[0].name) + setFileUploaded(e.target.files[0].name); readFile(e.target.files).catch(() => { console.error("Read uploaded file operation error"); }); diff --git a/src/redux/slices/layer-names-slice.ts b/src/redux/slices/layer-names-slice.ts index 73b2d5a2..104a3cdf 100644 --- a/src/redux/slices/layer-names-slice.ts +++ b/src/redux/slices/layer-names-slice.ts @@ -55,7 +55,7 @@ export const getLayerNameInfo = createAsyncThunk< { layerUrl: string | File; type: TilesetType; token: string } >("getLayerNameInfo", async ({ layerUrl, type, token }) => { if (typeof layerUrl !== "string") { - return { name: '', layerUrl: layerUrl.name }; + return { name: "", layerUrl: layerUrl.name }; } const params = parseTilesetUrlParams(layerUrl, { type, token }); let url = params.tilesetUrl;