浏览代码

Feature: sort the flashcard by the ':card-next-schedule' property

Signed-off-by: FelixGibson <[email protected]>
FelixGibson 3 年之前
父节点
当前提交
9f6aad98cf
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      src/main/frontend/extensions/srs.cljs

+ 4 - 2
src/main/frontend/extensions/srs.cljs

@@ -285,9 +285,11 @@
                                          (nil? next-sched)
                                          (nil? next-sched*)
                                          (t/before? next-sched* time))))
-                                 blocks)]
+                                 blocks),
+        sort-by-next-shedule   (sort-by (fn [b]
+                                (get (get b :block/properties) card-next-schedule-property)) filtered-result)]
     {:total (count blocks)
-     :result filtered-result}))
+     :result sort-by-next-shedule}))
 
 
 ;;; ================================================================