mirror of
https://github.com/correl/doom-modeline.git
synced 2024-11-23 19:19:50 +00:00
Fix: unable to get notifications asynchronously.
This commit is contained in:
parent
a06e1da04c
commit
4c8910e39d
1 changed files with 8 additions and 4 deletions
|
@ -1564,12 +1564,16 @@ mouse-3: Describe current input method")
|
||||||
(defun doom-modeline-github-fetch-notifications ()
|
(defun doom-modeline-github-fetch-notifications ()
|
||||||
"Fetch github notifications."
|
"Fetch github notifications."
|
||||||
(if (and doom-modeline-github
|
(if (and doom-modeline-github
|
||||||
(fboundp 'async-start)
|
(fboundp 'async-start))
|
||||||
(fboundp 'ghub-get))
|
|
||||||
(async-start
|
(async-start
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(ignore-errors
|
(package-initialize)
|
||||||
(ghub-get "/notifications" nil :query '((notifications . "true")))))
|
(require 'ghub nil t)
|
||||||
|
(when (fboundp 'ghub-get)
|
||||||
|
(ghub-get "/notifications"
|
||||||
|
nil
|
||||||
|
:query '((notifications . "true"))
|
||||||
|
:noerror t)))
|
||||||
(lambda (result)
|
(lambda (result)
|
||||||
(setq doom-modeline--github-notifications-number
|
(setq doom-modeline--github-notifications-number
|
||||||
(length result))))))
|
(length result))))))
|
||||||
|
|
Loading…
Reference in a new issue