From ff63959c032a8cc9a1c606a24e71c2fa1aa45f89 Mon Sep 17 00:00:00 2001 From: Vincent Zhang Date: Tue, 25 Dec 2018 02:14:42 +0800 Subject: [PATCH] Fix: checking github notifications asynchronously. --- doom-modeline.el | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/doom-modeline.el b/doom-modeline.el index f321e03..be657ad 100644 --- a/doom-modeline.el +++ b/doom-modeline.el @@ -1562,10 +1562,12 @@ mouse-3: Describe current input method") (fboundp 'async-start) (fboundp 'ghub-get)) (async-start - (setq doom-modeline--github-notifications-number - (length - (ignore-errors - (ghub-get "/notifications" nil :query '((notifications . "true"))))))))) + (lambda () + (ignore-errors + (ghub-get "/notifications" nil :query '((notifications . "true"))))) + (lambda (result) + (setq doom-modeline--github-notifications-number + (length result)))))) (run-with-timer 30 doom-modeline-github-interval