Skip to content

Commit

Permalink
Add support for updating forge notifications when the counter changes (
Browse files Browse the repository at this point in the history
…#680)

* Add support for updating forge notifications when the counter changes

* Switch to hook-based approach
  • Loading branch information
benthamite authored Dec 1, 2023
1 parent 8248f3f commit ca9637e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion doom-modeline-segments.el
Original file line number Diff line number Diff line change
Expand Up @@ -2211,6 +2211,10 @@ mouse-1: Toggle citre mode"
Example:
(add-hook \\='doom-modeline-before-github-fetch-notification-hook
#\\='auth-source-pass-enable)")

(defvar doom-modeline-after-github-fetch-notification-hook nil
"Hooks after fetching GitHub notifications.")

(defun doom-modeline--github-fetch-notifications ()
"Fetch GitHub notifications."
(when (and doom-modeline-github
Expand All @@ -2235,7 +2239,8 @@ Example:
:noerror t))))))
(lambda (result)
(message "") ; suppress message
(setq doom-modeline--github-notification-number (length result))))))
(setq doom-modeline--github-notification-number (length result))
(run-hooks 'doom-modeline-after-github-fetch-notification-hook)))))

(defvar doom-modeline--github-timer nil)
(defun doom-modeline-github-timer ()
Expand Down

0 comments on commit ca9637e

Please sign in to comment.