~Figure out why it's disappearing and fix the root issue~
I've tried for ~3 hours and don't want to put more time into it.
Get and cache the access token outside of the =deferred= block!
(after!
org-gcal
(defun cashpw/org-gcal--get-access-token (&rest r)
"Call `org-gcal--get-access-token' for the first calendar in the list."
(org-gcal--get-access-token (car (car org-gcal-file-alist))))
(advice-add 'org-gcal-sync :before #'cashpw/org-gcal--get-access-token)
(defvar org-gcal--access-token nil
"Set if a sync function is running.")
(defun org-gcal--sync-unlock ()
"Deactivate sync lock in case of failed sync."
(interactive)
(setq
org-gcal--sync-lock nil
org-gcal--access-token nil))
(defun org-gcal--get-access-token (calendar-id)
"Return the access token for CALENDAR-ID."
(if org-gcal--access-token
org-gcal--access-token
(setq org-gcal--access-token
(aio-wait-for (oauth2-auto-access-token calendar-id 'org-gcal))))))
Problem:
The decrypt password prompt disappears before I can type in the password (1-2 seconds). The only output in
*Messages*
is:Solutions:
~Figure out why it's disappearing and fix the root issue~
I've tried for ~3 hours and don't want to put more time into it.
Get and cache the access token outside of the =deferred= block!