mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2025-12-14 15:09:29 +00:00
fix: optimize authenticatedApi provider to not rebuild unnecessarily
This commit is contained in:
parent
e21977b894
commit
69a7dc4b1d
2 changed files with 2 additions and 3 deletions
|
|
@ -49,8 +49,7 @@ AudiobookshelfApi audiobookshelfApi(Ref ref, Uri? baseUrl) {
|
|||
/// if the user is not authenticated throw an error
|
||||
@Riverpod(keepAlive: true)
|
||||
AudiobookshelfApi authenticatedApi(Ref ref) {
|
||||
final apiSettings = ref.watch(apiSettingsProvider);
|
||||
final user = apiSettings.activeUser;
|
||||
final user = ref.watch(apiSettingsProvider.select((s) => s.activeUser));
|
||||
if (user == null) {
|
||||
_logger.severe('No active user can not provide authenticated api');
|
||||
throw StateError('No active user');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue