Fix trying to edit album even when there's no changes

This commit is contained in:
Ming Ming 2024-06-02 21:06:12 +08:00
parent eb80a509ec
commit 6784a8a545

View file

@ -236,12 +236,16 @@ class _Bloc extends Bloc<_Event, _State> with BlocLogger {
_log.info(ev); _log.info(ev);
emit(state.copyWith(isEditBusy: true)); emit(state.copyWith(isEditBusy: true));
try { try {
if (state.editName != null ||
state.editItems != null ||
state.editSort != null) {
await collectionsController.edit( await collectionsController.edit(
state.collection, state.collection,
name: state.editName, name: state.editName,
items: state.editItems, items: state.editItems,
itemSort: state.editSort, itemSort: state.editSort,
); );
}
emit(state.copyWith( emit(state.copyWith(
isEditMode: false, isEditMode: false,
isEditBusy: false, isEditBusy: false,