Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { Typography } from "../../../../ui/Typography";
import { ProfileFormFields } from "../ProfileFormFields";

interface Props {
onBlurName?: () => void;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unrelated to this issue, just some cleanup

logoSubtitle?: string;
coverSubtitle?: string;
disableHandle?: boolean;
Expand All @@ -18,7 +17,6 @@ interface Props {
}

export default function LensFormFields({
onBlurName,
logoSubtitle,
coverSubtitle,
disableHandle,
Expand All @@ -42,7 +40,6 @@ export default function LensFormFields({
<div>{children}</div>
</Grid>
<ProfileFormFields
onBlurName={onBlurName}
logoSubtitle={logoSubtitle}
coverSubtitle={coverSubtitle}
handleComponent={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { GridContainer } from "../../../ui/GridContainer";
import { ProfilePreview } from "./ProfilePreview";

interface Props {
onBlurName?: () => void;
logoSubtitle?: string;
coverSubtitle?: string;
handleComponent?: ReactNode;
Expand All @@ -23,7 +22,6 @@ interface Props {
}

export function ProfileFormFields({
onBlurName,
logoSubtitle,
coverSubtitle,
handleComponent: HandleComponent,
Expand Down Expand Up @@ -97,12 +95,7 @@ export function ProfileFormFields({
</FormField>
</GridContainer>
<FormField title="Your brand / name" required>
<Input
name="name"
placeholder="Name"
onBlur={onBlurName}
disabled={disableName}
/>
<Input name="name" placeholder="Name" disabled={disableName} />
</FormField>
{HandleComponent}
<FormField title="Description" required>
Expand Down
24 changes: 20 additions & 4 deletions src/pages/batch-create-offers/BatchCreateOffers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ function BatchCreateOffers() {
setOffersList([]);
setInvalidFile(false);
}
if (e.target) {
// reset value so the same file can be uploaded again (in case the file was modified)
e.target.value = "";
}
};

const sellerOffers = useOffers(
Expand Down Expand Up @@ -232,12 +236,24 @@ function BatchCreateOffers() {
if (hasUserRejectedTx) {
showModal("TRANSACTION_FAILED");
} else {
const defaultError = "Please retry this action";
const userFriendlyError = await extractUserFriendlyError(error, {
txResponse: txResponse as providers.TransactionResponse,
provider: signer?.provider as Provider,
defaultError
});
const isValidationError =
error &&
typeof error === "object" &&
"errors" in error &&
Array.isArray(error.errors) &&
Object.values(error.errors).every((err) => typeof err === "string");
showModal("TRANSACTION_FAILED", {
errorMessage: "Something went wrong",
detailedErrorMessage: await extractUserFriendlyError(error, {
txResponse: txResponse as providers.TransactionResponse,
provider: signer?.provider as Provider
})
detailedErrorMessage:
defaultError === userFriendlyError && isValidationError
? (error?.errors as string[])?.join("\n") || defaultError
: defaultError
});
}
}
Expand Down