Skip to content

Commit

Permalink
Fix dropdown error on new folder creation and shuffling of accounts
Browse files Browse the repository at this point in the history
  • Loading branch information
dhzdhd committed May 13, 2024
1 parent 24c8716 commit 00ff53a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
12 changes: 6 additions & 6 deletions lib/src/accounts/controllers/auth_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ class Auth extends _$Auth {
}
.map(
(r) {
state = [
...state
.where((e) => e != model)
.sortBy(Order.by((a) => a.hashCode, Order.orderInt)),
r
];
state = [...state, r].where((e) => e != model).sortBy(
Order.by(
(a) => DateTime.parse(a.createdAt),
Order.orderDate,
),
);
return r;
},
);
Expand Down
3 changes: 2 additions & 1 deletion lib/src/home/components/new_folder_dialog_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class _NewFolderDialogWidgetState extends ConsumerState<NewFolderDialogWidget> {
final selectedProvider = useState<Option<AuthProviderModel>>(const None());
final selectedFolder = useState<Option<String>>(const None());
final authInfo = ref.watch(authProvider);
final authInfoCopy = useState<List<AuthProviderModel>>(authInfo);
final createFolderController = ref.watch(createFolderControllerProvider);

ref.listen<AsyncValue>(
Expand All @@ -62,7 +63,7 @@ class _NewFolderDialogWidgetState extends ConsumerState<NewFolderDialogWidget> {
Padding(
padding: const EdgeInsets.only(top: 16.0),
child: DropdownButton<AuthProviderModel?>(
items: authInfo
items: authInfoCopy.value
.map(
(e) => DropdownMenuItem(
value: e,
Expand Down

0 comments on commit 00ff53a

Please sign in to comment.