Fix hang issue in fetching github notifications.

If there is no github access token, ghub requires to create and save from
minibuffer, thus will cause hang in async process. Just ignore it if no token.
This commit is contained in:
Vincent Zhang 2019-01-08 02:29:46 +08:00
parent a01d39b2e7
commit f2f7aaf392

View file

@ -1853,10 +1853,14 @@ mouse-3: Describe current input method")
(when (fboundp 'ghub-get)
(with-timeout (10)
(ignore-errors
(ghub-get "/notifications"
nil
:query '((notifications . "true"))
:noerror t)))))
(if (ghub--token ghub-default-host
(ghub--username ghub-default-host)
'ghub
t)
(ghub-get "/notifications"
nil
:query '((notifications . "true"))
:noerror t))))))
(lambda (result)
(setq doom-modeline--github-notifications-number
(length result))))))