Skip to content

Commit

Permalink
fix: signing out twice issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Xazin committed Oct 21, 2022
1 parent 8fefc00 commit 4341e1a
Show file tree
Hide file tree
Showing 5 changed files with 321 additions and 320 deletions.
5 changes: 2 additions & 3 deletions lib/application/auth/auth_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,8 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {
Emitter<AuthState> emit,
_SignedOut event,
) async {
emit(const AuthState.signingOut());
await _authRepository.signOut();
emit(const AuthState.unAuthenticated());
emit(const AuthState.unauthenticated());
}

FutureOr<void> _mapAuthCheckRequestToState(
Expand All @@ -92,7 +91,7 @@ class AuthBloc extends Bloc<AuthEvent, AuthState> {

emit(
userOption.fold(
() => const AuthState.unAuthenticated(),
() => const AuthState.unauthenticated(),
(user) => AuthState.authenticated(user),
),
);
Expand Down
4 changes: 1 addition & 3 deletions lib/application/auth/auth_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,5 @@ class AuthState with _$AuthState {
/// Splash Auth states
const factory AuthState.authenticated(User user) = _Authenticated;

const factory AuthState.signingOut() = _SigningOut;

const factory AuthState.unAuthenticated() = _UnAuthenticated;
const factory AuthState.unauthenticated() = _UnAuthenticated;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import 'package:auto_route/auto_route.dart';
import 'package:collaction_app/application/crowdaction/crowdaction_details/crowdaction_details_bloc.dart';
import 'package:collaction_app/presentation/crowdaction/crowdaction_participants/crowdaction_participants_screen.dart';
import 'package:collaction_app/presentation/routes/app_routes.gr.dart';
import 'package:collaction_app/presentation/shared_widgets/shimmers/title_shimmer_line.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
Expand Down
Loading

0 comments on commit 4341e1a

Please sign in to comment.