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) (when (fboundp 'ghub-get)
(with-timeout (10) (with-timeout (10)
(ignore-errors (ignore-errors
(ghub-get "/notifications" (if (ghub--token ghub-default-host
nil (ghub--username ghub-default-host)
:query '((notifications . "true")) 'ghub
:noerror t))))) t)
(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))))))