mirror of
https://github.com/immich-app/immich.git
synced 2025-05-31 12:15:47 -04: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
@ -16,7 +16,14 @@ class AlbumViewerEditableTitle extends HookConsumerWidget {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context, WidgetRef ref) {
|
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() {
|
void onFocusModeChange() {
|
||||||
if (!titleFocusNode.hasFocus && titleTextEditController.text.isEmpty) {
|
if (!titleFocusNode.hasFocus && titleTextEditController.text.isEmpty) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user