mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: sign in toast issue (#4895)
This commit is contained in:
parent
b57a870242
commit
80e210b34a
@ -27,8 +27,7 @@ Future<bool> afLaunchUrl(
|
||||
);
|
||||
} on PlatformException catch (e) {
|
||||
Log.error('Failed to open uri: $e');
|
||||
} finally {
|
||||
result = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
// if the uri is not a valid url, try to launch it with http scheme
|
||||
|
@ -89,8 +89,10 @@ class AppFlowyCloudDeepLink {
|
||||
Log.error('onDeepLinkError: Unexpected empty deep link callback');
|
||||
_completer?.complete(FlowyResult.failure(AuthError.emptyDeepLink));
|
||||
_completer = null;
|
||||
return;
|
||||
}
|
||||
return _isAuthCallbackDeepLink(uri!).fold(
|
||||
|
||||
return _isAuthCallbackDeepLink(uri).fold(
|
||||
(_) async {
|
||||
final deviceId = await getDeviceId();
|
||||
final payload = OauthSignInPB(
|
||||
@ -101,8 +103,7 @@ class AppFlowyCloudDeepLink {
|
||||
},
|
||||
);
|
||||
_stateNotifier?.value = DeepLinkResult(state: DeepLinkState.loading);
|
||||
final result =
|
||||
await UserEventOauthSignIn(payload).send().then((value) => value);
|
||||
final result = await UserEventOauthSignIn(payload).send();
|
||||
|
||||
_stateNotifier?.value = DeepLinkResult(
|
||||
state: DeepLinkState.finish,
|
||||
|
@ -72,8 +72,9 @@ class AppFlowyCloudAuthService implements AuthService {
|
||||
throw Exception('AppFlowyCloudDeepLink is not registered');
|
||||
}
|
||||
} else {
|
||||
completer
|
||||
.complete(FlowyResult.failure(AuthError.signInWithOauthError));
|
||||
completer.complete(
|
||||
FlowyResult.failure(AuthError.unableToGetDeepLink),
|
||||
);
|
||||
}
|
||||
|
||||
return completer.future;
|
||||
|
@ -29,4 +29,8 @@ class AuthError {
|
||||
static final deepLinkError = FlowyError()
|
||||
..msg = 'DeepLink error'
|
||||
..code = ErrorCode.Internal;
|
||||
|
||||
static final unableToGetDeepLink = FlowyError()
|
||||
..msg = 'Unable to get the deep link'
|
||||
..code = ErrorCode.Internal;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user