Skip to content

Commit

Permalink
Fix rowNestedProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
enm10k committed Jun 17, 2024
1 parent 4b1ee1d commit 2737acc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion lib/features/core/components/child_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ class ChildList extends HookConsumerWidget {
}
context.loaderOverlay.show();
await ref
.watch(rowNestedProvider(rowId, column, relation).notifier)
.read(rowNestedProvider(rowId, column, relation).notifier)
.load()
.then((final _) {
Future.delayed(
Expand Down
15 changes: 8 additions & 7 deletions lib/features/core/pages/link_record.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,17 @@ class _Card extends HookConsumerWidget {
subtitle: Text('PrimaryKey: $refRowId'),
onTap: () async {
await ref
.watch(
.read(
rowNestedProvider(rowId, column, relation, excluded: true)
.notifier,
)
.link(refRowId: refRowId)
.then((final msg) => notifySuccess(context, message: msg))
.onError(
(final error, final stackTrace) =>
notifyError(context, error, stackTrace),
);
.then((final msg) {
notifySuccess(context, message: msg);
}).onError(
(final error, final stackTrace) =>
notifyError(context, error, stackTrace),
);
},
),
);
Expand Down Expand Up @@ -90,7 +91,7 @@ class LinkRecordPage extends HookConsumerWidget {
}
context.loaderOverlay.show();
await ref
.watch(
.read(
rowNestedProvider(rowId, column, relation, excluded: true)
.notifier,
)
Expand Down
7 changes: 5 additions & 2 deletions lib/features/core/providers/providers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ class RowNested extends _$RowNested {
final String rowId,
final NcTableColumn column,
final NcTable relation, {
final excluded = false,
final bool excluded = false,
}) async {
final fn = excluded
? api.dbTableRowNestedChildrenExcludedList
Expand Down Expand Up @@ -513,7 +513,10 @@ class RowNested extends _$RowNested {
_invalidate() {
ref
..invalidateSelf()
..invalidate(dataRowsProvider);
..invalidate(dataRowsProvider)
..invalidate(
rowNestedProvider(rowId, column, relation, excluded: !excluded),
);
}

Future<String> remove({
Expand Down

0 comments on commit 2737acc

Please sign in to comment.