mirror of
https://github.com/immich-app/immich.git
synced 2025-03-11 02:23:09 -05:00
fix(mobile): retain edited title when album updates (#15806)
* fix(album-viewer): retain edited title when album updates ensure `AlbumViewerEditableTitle` keeps user input while editing, even when the album updates from another provider. fall back to `albumName` only when not in edit mode. * linting --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
parent
1b141d5ca9
commit
221e197633
1 changed files with 8 additions and 1 deletions
|
@ -16,7 +16,14 @@ class AlbumViewerEditableTitle extends HookConsumerWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final titleTextEditController = useTextEditingController(text: albumName);
|
||||
final albumViewerState = ref.watch(albumViewerProvider);
|
||||
|
||||
final titleTextEditController = useTextEditingController(
|
||||
text: albumViewerState.isEditAlbum &&
|
||||
albumViewerState.editTitleText.isNotEmpty
|
||||
? albumViewerState.editTitleText
|
||||
: albumName,
|
||||
);
|
||||
|
||||
void onFocusModeChange() {
|
||||
if (!titleFocusNode.hasFocus && titleTextEditController.text.isEmpty) {
|
||||
|
|
Loading…
Add table
Reference in a new issue