Fix: checking github notifications asynchronously.

This commit is contained in:
Vincent Zhang 2018-12-25 02:14:42 +08:00
parent f4d9aabcd6
commit ff63959c03

View file

@ -1562,10 +1562,12 @@ mouse-3: Describe current input method")
(fboundp 'async-start) (fboundp 'async-start)
(fboundp 'ghub-get)) (fboundp 'ghub-get))
(async-start (async-start
(setq doom-modeline--github-notifications-number (lambda ()
(length (ignore-errors
(ignore-errors (ghub-get "/notifications" nil :query '((notifications . "true")))))
(ghub-get "/notifications" nil :query '((notifications . "true"))))))))) (lambda (result)
(setq doom-modeline--github-notifications-number
(length result))))))
(run-with-timer 30 (run-with-timer 30
doom-modeline-github-interval doom-modeline-github-interval