fix(auth): fix bug on hot refresh
This commit is contained in:
		
							parent
							
								
									719fa83576
								
							
						
					
					
						commit
						ba4f3a7b4a
					
				@ -45,18 +45,20 @@ class AuthenticationCubit<Extra> extends Cubit<AuthenticationState<Extra>> {
 | 
			
		||||
      _authenticationRepository.cubitStatus.last;
 | 
			
		||||
 | 
			
		||||
  void _subscribeStatus() {
 | 
			
		||||
    _statusSubscription = _authenticationRepository.cubitStatus.listen(
 | 
			
		||||
      (status) {
 | 
			
		||||
        switch (status) {
 | 
			
		||||
          case AuthCubitStatus.started:
 | 
			
		||||
            start();
 | 
			
		||||
            break;
 | 
			
		||||
          case AuthCubitStatus.stoped:
 | 
			
		||||
            stop();
 | 
			
		||||
            break;
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
    );
 | 
			
		||||
    try {
 | 
			
		||||
      _statusSubscription = _authenticationRepository.cubitStatus.listen(
 | 
			
		||||
        (status) {
 | 
			
		||||
          switch (status) {
 | 
			
		||||
            case AuthCubitStatus.started:
 | 
			
		||||
              start();
 | 
			
		||||
              break;
 | 
			
		||||
            case AuthCubitStatus.stoped:
 | 
			
		||||
              stop();
 | 
			
		||||
              break;
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
      );
 | 
			
		||||
    } catch (_) {}
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  Future<void> init() async {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user