Skip to content

Commit

Permalink
fix: unselect notes after renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
ZebraVogel94349 authored and adil192 committed Jan 29, 2024
1 parent 9cb324a commit 2d3facf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/components/home/rename_note_button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ class RenameNoteButton extends StatelessWidget {
const RenameNoteButton({
super.key,
required this.existingPath,
required this.unselectNotes,
});

final String existingPath;
final void Function() unselectNotes;

@override
Widget build(BuildContext context) {
Expand All @@ -27,6 +29,7 @@ class RenameNoteButton extends StatelessWidget {
builder: (BuildContext context) {
return _RenameNoteDialog(
existingPath: existingPath,
unselectNotes: unselectNotes,
);
},
);
Expand All @@ -41,9 +44,11 @@ class _RenameNoteDialog extends StatefulWidget {
// ignore: unused_element
super.key,
required this.existingPath,
required this.unselectNotes,
});

final String existingPath;
final void Function() unselectNotes;

@override
State<_RenameNoteDialog> createState() => _RenameNoteDialogState();
Expand Down Expand Up @@ -126,6 +131,7 @@ class _RenameNoteDialogState extends State<_RenameNoteDialog> {
}
if (!context.mounted) return;
Navigator.of(context).pop();
widget.unselectNotes();
},
child: Text(t.home.renameNote.rename),
),
Expand Down
1 change: 1 addition & 0 deletions lib/pages/home/browse.dart
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ class _BrowsePageState extends State<BrowsePage> {
existingPath: selectedFiles.value.isEmpty
? ''
: selectedFiles.value.first,
unselectNotes: () => selectedFiles.value = [],
)),
MoveNoteButton(
filesToMove: selectedFiles.value,
Expand Down
1 change: 1 addition & 0 deletions lib/pages/home/recent_notes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ class _RecentPageState extends State<RecentPage> {
existingPath: selectedFiles.value.isEmpty
? ''
: selectedFiles.value.first,
unselectNotes: () => selectedFiles.value = [],
),
),
MoveNoteButton(
Expand Down

0 comments on commit 2d3facf

Please # to comment.