From 0c3097abb29bc5334f8c27bd6434b0ea3d6dd8e2 Mon Sep 17 00:00:00 2001 From: Roman Volosovskyi Date: Tue, 19 Apr 2022 12:51:20 +0200 Subject: [PATCH] [#13257] Fix sync devices sorting --- src/status_im/pairing/core.cljs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/status_im/pairing/core.cljs b/src/status_im/pairing/core.cljs index 90593bbdd4..906f2ceb56 100644 --- a/src/status_im/pairing/core.cljs +++ b/src/status_im/pairing/core.cljs @@ -43,12 +43,10 @@ (= our-installation-id (:installation-id b)) 1 :else - (let [enabled-compare (compare (:enabled? b) - (:enabled? a))] + (let [enabled-compare (compare (:enabled? b) (:enabled? a))] (if (not= 0 enabled-compare) enabled-compare - (compare (:timestamp b) - (:timestamp a)))))) + (compare (:timestamp a) (:timestamp b)))))) (defn sort-installations [our-installation-id installations] @@ -189,10 +187,10 @@ :params [(or preferred-name name) identicon] :on-success #(log/debug "successfully synced devices")}]})) -(defn installation<-rpc [{:keys [metadata id enabled]}] +(defn installation<-rpc [{:keys [metadata id enabled timestamp]}] {:installation-id id :name (:name metadata) - :timestamp (:timestamp metadata) + :timestamp timestamp :device-type (:deviceType metadata) :enabled? enabled})