0
Fork 0
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:
Mangat Singh Toor | ਮੰਗਤ ਸਿੰਘ ਤੂਰ 2025-01-31 07:24:53 -08:00 committed by GitHub
parent 1b141d5ca9
commit 221e197633
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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) {