Skip to content

Commit

Permalink
allow webp files as profile images
Browse files Browse the repository at this point in the history
  • Loading branch information
ginesdt committed Dec 11, 2023
1 parent c0219ef commit 049189d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/streamtide/ui/my_settings/page.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
:accept "image/*"
:errors errors
:file-accept-pred (fn [{:keys [name type size] :as props}]
(and (#{"image/png" "image/gif" "image/jpeg" "image/svg+xml"} type)
(and (#{"image/png" "image/gif" "image/jpeg" "image/svg+xml" "image/webp"} type)
(< size max-filesize)))
:on-file-accepted (fn [{:keys [name type size array-buffer] :as props}]
(swap! form-data update-in [id] dissoc :error)
Expand All @@ -201,7 +201,7 @@
:on-file-rejected (fn [{:keys [name type size] :as props}]
(swap! form-data assoc id {:error (if (>= size max-filesize)
"File too large (> 3MB)"
"Non .png .jpeg .gif .svg file selected")})
"Non .png .jpeg .gif .svg .webp file selected")})
(reset! form-data (with-meta @form-data {:touched? true}))
(log/warn "Rejected file" {:name name :type type :size size} ::file-rejected))}])

Expand Down

0 comments on commit 049189d

Please sign in to comment.