chore: fix ws conn (#4582)

* chore: fix ws conn

* chore: flutter analyzer

* chore: update client api
This commit is contained in:
Nathan.fooo
2024-02-02 09:27:11 +08:00
committed by GitHub
parent 9746852b5f
commit 722691c922
8 changed files with 84 additions and 44 deletions

View File

@ -54,7 +54,10 @@ Future<AuthenticatorType> getAuthenticatorType() async {
final value = await getIt<KeyValueStorage>().get(KVKeys.kCloudType);
if (value.isNone() && !integrationMode().isUnitTest) {
// if the cloud type is not set, then set it to AppFlowy Cloud as default.
await useAppFlowyBetaCloudWithURL(kAppflowyCloudUrl);
await useAppFlowyBetaCloudWithURL(
kAppflowyCloudUrl,
AuthenticatorType.appflowyCloud,
);
return AuthenticatorType.appflowyCloud;
}
@ -70,7 +73,10 @@ Future<AuthenticatorType> getAuthenticatorType() async {
case "4":
return AuthenticatorType.appflowyCloudDevelop;
default:
await useAppFlowyBetaCloudWithURL(kAppflowyCloudUrl);
await useAppFlowyBetaCloudWithURL(
kAppflowyCloudUrl,
AuthenticatorType.appflowyCloud,
);
return AuthenticatorType.appflowyCloud;
}
}
@ -183,8 +189,11 @@ Future<void> useSelfHostedAppFlowyCloudWithURL(String url) async {
await _setAppFlowyCloudUrl(Some(url));
}
Future<void> useAppFlowyBetaCloudWithURL(String url) async {
await _setAuthenticatorType(AuthenticatorType.appflowyCloud);
Future<void> useAppFlowyBetaCloudWithURL(
String url,
AuthenticatorType authenticatorType,
) async {
await _setAuthenticatorType(authenticatorType);
await _setAppFlowyCloudUrl(Some(url));
}