Skip to content

Commit

Permalink
fix: Fix dependents error when switching accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
astubenbord committed May 12, 2023
1 parent 2fad76c commit 3eaec1b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
5 changes: 3 additions & 2 deletions lib/features/document_search/view/sliver_search_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,11 @@ class SliverSearchBar extends StatelessWidget {
},
),
onPressed: () {
final apiVersion = context.read<ApiVersion>();
showDialog(
context: context,
builder: (_) => Provider.value(
value: context.read<ApiVersion>(),
builder: (context) => Provider.value(
value: apiVersion,
child: const ManageAccountsPage(),
),
);
Expand Down
17 changes: 7 additions & 10 deletions lib/features/home/view/home_route.dart
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,13 @@ class HomeRoute extends StatelessWidget {
providers: [
ProxyProvider3<PaperlessDocumentsApi, DocumentChangedNotifier, LabelRepository,
DocumentsCubit>(
update: (context, docApi, notifier, labelRepo, previous) {
print("UPDATED DOCUMENT CUBIT"); //TODO: REMOVE
return DocumentsCubit(
docApi,
notifier,
labelRepo,
Hive.box<LocalUserAppState>(HiveBoxes.localUserAppState)
.get(currentLocalUserId)!,
)..reload();
},
update: (context, docApi, notifier, labelRepo, previous) => DocumentsCubit(
docApi,
notifier,
labelRepo,
Hive.box<LocalUserAppState>(HiveBoxes.localUserAppState)
.get(currentLocalUserId)!,
)..reload(),
),
Provider(create: (context) => DocumentScannerCubit()),
ProxyProvider4<PaperlessDocumentsApi, PaperlessServerStatsApi, LabelRepository,
Expand Down

0 comments on commit 3eaec1b

Please sign in to comment.