fix: Enable logging in production

This commit is contained in:
Anton Stubenbord
2023-10-19 18:26:02 +02:00
parent 7d1c0dffe4
commit 520bfbd7b1
104 changed files with 632 additions and 257 deletions

View File

@@ -22,7 +22,11 @@ class DocumentEditCubit extends Cubit<DocumentEditState> {
required DocumentModel document,
}) : _initialDocument = document,
super(DocumentEditState(document: document)) {
_notifier.addListener(this, onUpdated: replace);
_notifier.addListener(this, onUpdated: (doc) {
if (doc.id == document.id) {
emit(state.copyWith(document: doc));
}
});
_labelRepository.addListener(
this,
onChanged: (labels) {
@@ -69,10 +73,6 @@ class DocumentEditCubit extends Cubit<DocumentEditState> {
emit(state.copyWith(suggestions: suggestions));
}
void replace(DocumentModel document) {
emit(state.copyWith(document: document));
}
@override
Future<void> close() {
_notifier.removeListener(this);