mirror of
https://github.com/correl/doom-modeline.git
synced 2024-11-23 19:19:50 +00:00
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:
parent
a01d39b2e7
commit
f2f7aaf392
1 changed files with 8 additions and 4 deletions
|
@ -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
|
||||||
|
(if (ghub--token ghub-default-host
|
||||||
|
(ghub--username ghub-default-host)
|
||||||
|
'ghub
|
||||||
|
t)
|
||||||
(ghub-get "/notifications"
|
(ghub-get "/notifications"
|
||||||
nil
|
nil
|
||||||
:query '((notifications . "true"))
|
:query '((notifications . "true"))
|
||||||
:noerror t)))))
|
: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