Line data Source code
1 : import 'package:redux/redux.dart';
2 :
3 : import '../../../extensions.dart';
4 : import '../../../services.dart';
5 : import '../../../types.dart';
6 : import '../../settings/enums/platform_enum.dart';
7 : import '../actions/sign_in_with_git_hub_action.dart';
8 :
9 : class SignInWithGitHubMiddleware<T extends RedFireState>
10 : extends TypedMiddleware<T, SignInWithGitHubAction> {
11 0 : SignInWithGitHubMiddleware()
12 0 : : super((store, action, next) async {
13 0 : next(action);
14 :
15 : try {
16 0 : if (store.state.settings.platform == PlatformsEnum.web) {
17 0 : final service = RedFireLocator.getAuthService();
18 0 : await service.signInWithGithubOnWeb();
19 : }
20 : } catch (error, trace) {
21 0 : store.dispatchProblem(error, trace);
22 : }
23 : });
24 : }
|