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) {
|
} on PlatformException catch (e) {
|
||||||
Log.error('Failed to open uri: $e');
|
Log.error('Failed to open uri: $e');
|
||||||
} finally {
|
return false;
|
||||||
result = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// if the uri is not a valid url, try to launch it with http scheme
|
// 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');
|
Log.error('onDeepLinkError: Unexpected empty deep link callback');
|
||||||
_completer?.complete(FlowyResult.failure(AuthError.emptyDeepLink));
|
_completer?.complete(FlowyResult.failure(AuthError.emptyDeepLink));
|
||||||
_completer = null;
|
_completer = null;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
return _isAuthCallbackDeepLink(uri!).fold(
|
|
||||||
|
return _isAuthCallbackDeepLink(uri).fold(
|
||||||
(_) async {
|
(_) async {
|
||||||
final deviceId = await getDeviceId();
|
final deviceId = await getDeviceId();
|
||||||
final payload = OauthSignInPB(
|
final payload = OauthSignInPB(
|
||||||
@ -101,8 +103,7 @@ class AppFlowyCloudDeepLink {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
_stateNotifier?.value = DeepLinkResult(state: DeepLinkState.loading);
|
_stateNotifier?.value = DeepLinkResult(state: DeepLinkState.loading);
|
||||||
final result =
|
final result = await UserEventOauthSignIn(payload).send();
|
||||||
await UserEventOauthSignIn(payload).send().then((value) => value);
|
|
||||||
|
|
||||||
_stateNotifier?.value = DeepLinkResult(
|
_stateNotifier?.value = DeepLinkResult(
|
||||||
state: DeepLinkState.finish,
|
state: DeepLinkState.finish,
|
||||||
|
@ -72,8 +72,9 @@ class AppFlowyCloudAuthService implements AuthService {
|
|||||||
throw Exception('AppFlowyCloudDeepLink is not registered');
|
throw Exception('AppFlowyCloudDeepLink is not registered');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
completer
|
completer.complete(
|
||||||
.complete(FlowyResult.failure(AuthError.signInWithOauthError));
|
FlowyResult.failure(AuthError.unableToGetDeepLink),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return completer.future;
|
return completer.future;
|
||||||
|
@ -29,4 +29,8 @@ class AuthError {
|
|||||||
static final deepLinkError = FlowyError()
|
static final deepLinkError = FlowyError()
|
||||||
..msg = 'DeepLink error'
|
..msg = 'DeepLink error'
|
||||||
..code = ErrorCode.Internal;
|
..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