Skip to content

Commit

Permalink
fix(launchpad): Add missing type usage, remove useless async await
Browse files Browse the repository at this point in the history
  • Loading branch information
WaDadidou committed Jan 5, 2025
1 parent 3344964 commit 8f25d69
Showing 1 changed file with 9 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,10 @@ import { useFieldArray, useFormContext } from "react-hook-form";
import { SafeAreaView, TouchableOpacity, View } from "react-native";

import { AssetModal } from "./AssetModal";
import { AssetsAndMetadataIssue } from "./AssetsAndMetadataIssue";
import {
AssetsAndMetadataIssue,
AssetsAndMetadataIssueObject,
} from "./AssetsAndMetadataIssue";

import trashSVG from "@/assets/icons/trash.svg";
import { BrandText } from "@/components/BrandText";
Expand Down Expand Up @@ -57,25 +60,13 @@ export const AssetsTab: React.FC = () => {
const [assetModalVisible, setAssetModalVisible] = useState(false);
const selectedElem = fields.find((_, index) => index === selectedElemIndex);
const [attributesIssues, setAttributesIssues] = useState<
{
title: string;
message: string;
type: "error" | "warning";
}[]
AssetsAndMetadataIssueObject[]
>([]);
const [assetsIssues, setAssetsIssues] = useState<
{
title: string;
message: string;
type: "error" | "warning";
}[]
AssetsAndMetadataIssueObject[]
>([]);
const [imagesIssues, setImagesIssues] = useState<
{
title: string;
message: string;
type: "error" | "warning";
}[]
AssetsAndMetadataIssueObject[]
>([]);

const attributesIdsSeparator = ",";
Expand Down Expand Up @@ -292,15 +283,15 @@ export const AssetsTab: React.FC = () => {
};

// On upload assets CSV mapping file
const onUploadAssetsMappingFile = async (files: LocalFileData[]) => {
const onUploadAssetsMappingFile = (files: LocalFileData[]) => {
resetIssuesErrors();
setAssetsIssues([]);
setImagesIssues([]);
assetsMetadatasForm.setValue("assetsMetadatas", []);
imagesUploaderRef.current?.resetFiles();

try {
await parse<string[]>(files[0].file, {
parse<string[]>(files[0].file, {
complete: (parseResults) => {
const assetsDataRows = parseResults.data;
const attributesDataRows = attributesMappingDataRows; // attributesMappingDataRows is clean here
Expand Down

0 comments on commit 8f25d69

Please sign in to comment.