Skip to content

Commit

Permalink
Add TODOs for notifying user at 3 image/video limit, see https://twit…
Browse files Browse the repository at this point in the history
  • Loading branch information
josephfrazier committed Sep 4, 2023
1 parent 4807c2e commit f41e19d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/routes/home/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,7 @@ class Home extends React.Component {
};

handleAttachmentData = async ({ attachmentData }) => {
// TODO: check isImage or isVideo here, show warning/error toast if there's 3 of the given type already, see https://twitter.com/josephfrazier_/status/1698419554915954932
this.setState(
state => ({
attachmentData: state.attachmentData.concat(attachmentData),
Expand All @@ -641,6 +642,7 @@ class Home extends React.Component {

// eslint-disable-next-line no-await-in-loop
const { ext } = await FileType.fromBuffer(attachmentBuffer);
// TOOD is FileType the right way to get the proper `ext` to feed to isImage and isVideo?

return Promise.allSettled([
extractPlate({
Expand Down Expand Up @@ -1116,6 +1118,7 @@ class Home extends React.Component {
>
{this.state.attachmentData.map(attachmentFile => {
const { name } = attachmentFile;
// TODO is fileExtension the right way to get the proper `ext` for isImage and isVideo?
const ext = fileExtension(name);
const isImg = isImage({ ext });
const src = getBlobUrl(attachmentFile);
Expand Down

0 comments on commit f41e19d

Please sign in to comment.