[#13257] Fix sync devices sorting
This commit is contained in:
parent
fd6b14fccc
commit
0c3097abb2
|
@ -43,12 +43,10 @@
|
||||||
(= our-installation-id (:installation-id b))
|
(= our-installation-id (:installation-id b))
|
||||||
1
|
1
|
||||||
:else
|
:else
|
||||||
(let [enabled-compare (compare (:enabled? b)
|
(let [enabled-compare (compare (:enabled? b) (:enabled? a))]
|
||||||
(:enabled? a))]
|
|
||||||
(if (not= 0 enabled-compare)
|
(if (not= 0 enabled-compare)
|
||||||
enabled-compare
|
enabled-compare
|
||||||
(compare (:timestamp b)
|
(compare (:timestamp a) (:timestamp b))))))
|
||||||
(:timestamp a))))))
|
|
||||||
|
|
||||||
(defn sort-installations
|
(defn sort-installations
|
||||||
[our-installation-id installations]
|
[our-installation-id installations]
|
||||||
|
@ -189,10 +187,10 @@
|
||||||
:params [(or preferred-name name) identicon]
|
:params [(or preferred-name name) identicon]
|
||||||
:on-success #(log/debug "successfully synced devices")}]}))
|
: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
|
{:installation-id id
|
||||||
:name (:name metadata)
|
:name (:name metadata)
|
||||||
:timestamp (:timestamp metadata)
|
:timestamp timestamp
|
||||||
:device-type (:deviceType metadata)
|
:device-type (:deviceType metadata)
|
||||||
:enabled? enabled})
|
:enabled? enabled})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue