diff --git a/lib/features/notes/presentation/bloc/notes/notes_bloc.dart b/lib/features/notes/presentation/bloc/notes/notes_bloc.dart index 853ffb84..5f9b59ed 100644 --- a/lib/features/notes/presentation/bloc/notes/notes_bloc.dart +++ b/lib/features/notes/presentation/bloc/notes/notes_bloc.dart @@ -67,20 +67,18 @@ class NotesBloc extends Bloc { on((event, emit) { // we don't want to update when something is getting saved or deleted + // so we need to process the body afterwards to get current list of assets, and suitably delete removed ones - if (state is NoteInitialState || state is NoteUpdatedState) { - // so we need to process the body afterwards to get current list of assets, and suitably delete removed ones - emit(NoteUpdatedState( - newNote: state.newNote!, - id: state.id, - title: event.title ?? state.title!, - controller: state.controller!, - createdAt: event.createdAt ?? state.createdAt!, - allNoteAssets: event.noteAsset != null - ? [...state.allNoteAssets!, event.noteAsset!] - : state.allNoteAssets!, - )); - } + emit(NoteUpdatedState( + newNote: state.newNote!, + id: state.id, + title: event.title ?? state.title!, + controller: state.controller!, + createdAt: event.createdAt ?? state.createdAt!, + allNoteAssets: event.noteAsset != null + ? [...state.allNoteAssets!, event.noteAsset!] + : state.allNoteAssets!, + )); }); on((event, emit) async {