Skip to content

Commit

Permalink
Merge pull request #7555 from LedgerHQ/bugfix/live-12513-custom-locks…
Browse files Browse the repository at this point in the history
…creen-gifs

[LIVE-12513] Fix(lld/customlockscreen): disallow selection of gifs
  • Loading branch information
ofreyssinet-ledger authored Aug 9, 2024
2 parents 1fb2b90 + aa9110f commit 2dd4825
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/shaggy-avocados-suffer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"ledger-live-desktop": patch
---

Custom lock screen: disallow selection of gifs
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,20 @@ type Props = {
onClick: () => void;
};

const acceptedMimeTypes = [
"image/jpeg",
"image/png",
"image/bmp",
"image/webp",
"image/tiff",
"image/heif",
"image/heic",
];
const acceptedMimeTypesString = acceptedMimeTypes.join(", ");

const ImageInput = styled.input.attrs({
type: "file",
accept: "image/*",
accept: acceptedMimeTypesString,
title: "",
value: "",
})`
Expand All @@ -40,7 +51,7 @@ const ImportImage: React.FC<Props> = ({ setLoading, onResult, onError, onClick }
try {
const reader = new FileReader();
if (!file) return;
if (!file.type.startsWith("image/")) {
if (!acceptedMimeTypes.includes(file.type)) {
onError(new ImageIncorrectFileTypeError());
return;
}
Expand Down

0 comments on commit 2dd4825

Please sign in to comment.