Skip to content

Conversation

jakeprobst
Copy link
Contributor

I was looking in anki to see how day rollover is managed so I can run code around when it triggers for an addon I am working on and saw that it was trivial to add a hook for it! I get that I can hook the main_window_did_init and then duplicate this logic in my addon, but this seems like a nice thing to have a hook for.

The use case for me is for it to be used in conjunction with cases I'd hook profile_did_open for, but to also handle cases where I left anki on overnight and would like the logic to still run without having to close and reopen anki.

My feelings on this aren't particuarly strong so feel free to close this PR if this is not desired.

@jakeprobst jakeprobst force-pushed the rollover_hook branch 2 times, most recently from 633988c to f89de4b Compare February 13, 2025 08:06
@dae
Copy link
Member

dae commented Feb 16, 2025

The hook seems useful, my only request is that you follow the naming convention (e.g day_did_change)

@dae
Copy link
Member

dae commented Feb 18, 2025

Thanks!

@dae dae merged commit 5552fc6 into ankitects:main Feb 18, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants