AnkiHubSoftware / ankihub_addon

3 stars 0 forks source link

[BUILD-693] fix: Update feature flags when auth token changes #1019

Closed RisingOrange closed 1 month ago

RisingOrange commented 1 month ago

Currently feature flags are only fetched when Anki is started.

This leads to issues, for example the AnkiHub AI features are not appearing on the add-on sometimes because the auth token is outdated when Anki starts and because of this the feature flags can't be fetched. When this is the case, the user will be asked to login when syncing (which happens automatically on startup for most users). However, we are currently not updating the feature flags after they login, leaving them without the feature-flat protected features.

This PR fixes this by fetching feature flags after the user logs in.

Related issues

https://ankihub.atlassian.net/browse/BUILD-693

Proposed changes