diff options
author | Leon Rische <leon.rische@me.com> | 2020-02-02 20:08:21 +0100 |
---|---|---|
committer | Leon Rische <leon.rische@me.com> | 2020-02-02 20:08:21 +0100 |
commit | 1ca35ff6e5d1de3cfefd6bf02c438a457e2f6fc8 (patch) | |
tree | f9cc62923b2088f712f4d88aacb9c7add171daeb /org-fc-dashboard.el | |
parent | 490a7088dcc92e98943f540577f07aa80f3e45df (diff) |
Check if review history file exists before loading it
Diffstat (limited to 'org-fc-dashboard.el')
-rw-r--r-- | org-fc-dashboard.el | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/org-fc-dashboard.el b/org-fc-dashboard.el index 7f9357c..97dab2e 100644 --- a/org-fc-dashboard.el +++ b/org-fc-dashboard.el @@ -117,22 +117,24 @@ (insert "\n") - (insert - (propertize " Review Statistics\n\n" 'face 'org-level-1)) - - (dolist (scope '((:day . "Day") - (:week . "Week") - (:month . "Month") - (:all . "All"))) - (when-let (stat (plist-get reviews-stats (car scope))) - (when (plusp (plist-get stat :total)) - (insert (propertize (format " %s (%d)\n" (cdr scope) (plist-get stat :total)) 'face 'org-level-1)) - (insert " ") - (insert-image (org-fc-dashboard-bar-chart stat)) - (insert (org-fc-dashboard-percent-right stat)) - (insert "\n\n")))) + (when reviews-stats + (insert + (propertize " Review Statistics\n\n" 'face 'org-level-1)) + + (dolist (scope '((:day . "Day") + (:week . "Week") + (:month . "Month") + (:all . "All"))) + (when-let (stat (plist-get reviews-stats (car scope))) + (when (plusp (plist-get stat :total)) + (insert (propertize (format " %s (%d)\n" (cdr scope) (plist-get stat :total)) 'face 'org-level-1)) + (insert " ") + (insert-image (org-fc-dashboard-bar-chart stat)) + (insert (org-fc-dashboard-percent-right stat)) + (insert "\n\n")))) + + (insert "\n")) - (insert "\n") (insert (propertize " [r] Review\n" 'face 'org-level-1)) (insert |