forked from eatvio/eatvio_app
feat(app): refactoring of sentry using, feat(become_consultant): fixed possible infinite loading, feat(push_notifications): fixed push navigation from paid plan push
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import 'package:eatvio_app/features/profile/presentation/bloc/sub_cubit/sub_state.dart';
|
||||
import 'package:eatvio_app/features/profile/repositories/profile_repository.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:eatvio_app/core/error_reporting/report_from.dart';
|
||||
|
||||
class SubCubit extends Cubit<SubState> {
|
||||
final ProfileRepository profileRepository;
|
||||
@@ -16,7 +17,8 @@ class SubCubit extends Cubit<SubState> {
|
||||
return;
|
||||
}
|
||||
emit(SubState.loaded(subList: await profileRepository.getSubscriptionsBySlug(slug, query)));
|
||||
} catch (e) {
|
||||
} catch (e, st) {
|
||||
await reportFrom(e, st, this);
|
||||
emit(SubState.error(errorMessage: e.toString()));
|
||||
}
|
||||
}
|
||||
@@ -30,16 +32,25 @@ class SubCubit extends Cubit<SubState> {
|
||||
return;
|
||||
}
|
||||
emit(SubState.loaded(subList: await profileRepository.getSubscribersBySlug(slug, query)));
|
||||
} catch (e) {
|
||||
} catch (e, st) {
|
||||
await reportFrom(e, st, this);
|
||||
emit(SubState.error(errorMessage: e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> subscribe(String slug) async {
|
||||
return await profileRepository.subscribe(slug);
|
||||
try {
|
||||
await profileRepository.subscribe(slug);
|
||||
} catch (e, st) {
|
||||
await reportFrom(e, st, this);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> unsubscribe(String slug) async {
|
||||
return await profileRepository.unsubscribe(slug);
|
||||
try {
|
||||
await profileRepository.unsubscribe(slug);
|
||||
} catch (e, st) {
|
||||
await reportFrom(e, st, this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user