mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-14 10:46:21 +00:00
fix: image dimensions on Android (#15211)
This commit is contained in:
parent
51276237f2
commit
f9dda56310
@ -31,7 +31,9 @@
|
|||||||
(fn [^js resized-image]
|
(fn [^js resized-image]
|
||||||
(let [path (.-path resized-image)
|
(let [path (.-path resized-image)
|
||||||
path (if (string/starts-with? path "file") path (str "file://" path))]
|
path (if (string/starts-with? path "file") path (str "file://" path))]
|
||||||
(cb path)))
|
(cb {:resized-uri path
|
||||||
|
:width width
|
||||||
|
:height height})))
|
||||||
#(log/error "could not resize image" %))))))
|
#(log/error "could not resize image" %))))))
|
||||||
|
|
||||||
(defn result->id
|
(defn result->id
|
||||||
@ -238,13 +240,15 @@
|
|||||||
|
|
||||||
(rf/defn image-selected
|
(rf/defn image-selected
|
||||||
{:events [:chat.ui/image-selected]}
|
{:events [:chat.ui/image-selected]}
|
||||||
[{:keys [db]} current-chat-id original uri]
|
[{:keys [db]} current-chat-id original {:keys [resized-uri width height]}]
|
||||||
{:db
|
{:db
|
||||||
(update-in db
|
(update-in db
|
||||||
[:chat/inputs current-chat-id :metadata :sending-image (:uri original)]
|
[:chat/inputs current-chat-id :metadata :sending-image (:uri original)]
|
||||||
merge
|
merge
|
||||||
original
|
original
|
||||||
{:resized-uri uri})})
|
{:resized-uri resized-uri
|
||||||
|
:width width
|
||||||
|
:height height})})
|
||||||
|
|
||||||
(rf/defn image-unselected
|
(rf/defn image-unselected
|
||||||
{:events [:chat.ui/image-unselected]}
|
{:events [:chat.ui/image-unselected]}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user