mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
refactor: remove singleton db (#4208)
* refactor: remove singleton db * chore: fix warning * chore: fix warning * chore: update test * chore: only resotre or backup when init call * test: fix * test: fix * test: fix * fix: timeout notification * chore: rename * chore: rename * chore: disable test * chore: remove log * chore: remove log * chore: add log * chore: rename test functions * chore: add test asset * chore: bump client api * chore: disable some tests
This commit is contained in:
17
frontend/appflowy_flutter/lib/env/cloud_env.dart
vendored
17
frontend/appflowy_flutter/lib/env/cloud_env.dart
vendored
@ -105,7 +105,7 @@ enum AuthenticatorType {
|
||||
supabase,
|
||||
appflowyCloud;
|
||||
|
||||
bool get isEnabled => this != AuthenticatorType.local;
|
||||
bool get isLocal => this == AuthenticatorType.local;
|
||||
int get value {
|
||||
switch (this) {
|
||||
case AuthenticatorType.local:
|
||||
@ -161,8 +161,12 @@ class AppFlowyCloudSharedEnv {
|
||||
if (Env.enableCustomCloud) {
|
||||
// Use the custom cloud configuration.
|
||||
final cloudType = await getAuthenticatorType();
|
||||
final appflowyCloudConfig = await getAppFlowyCloudConfig();
|
||||
final supabaseCloudConfig = await getSupabaseCloudConfig();
|
||||
final appflowyCloudConfig = cloudType.isLocal
|
||||
? AppFlowyCloudConfiguration.defaultConfig()
|
||||
: await getAppFlowyCloudConfig();
|
||||
final supabaseCloudConfig = cloudType.isLocal
|
||||
? SupabaseConfiguration.defaultConfig()
|
||||
: await getSupabaseCloudConfig();
|
||||
|
||||
return AppFlowyCloudSharedEnv(
|
||||
authenticatorType: cloudType,
|
||||
@ -184,6 +188,13 @@ class AppFlowyCloudSharedEnv {
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'authenticator: $_authenticatorType\n'
|
||||
'appflowy: ${appflowyCloudConfig.toJson()}\n'
|
||||
'supabase: ${supabaseConfig.toJson()})\n';
|
||||
}
|
||||
}
|
||||
|
||||
Future<AppFlowyCloudConfiguration> configurationFromUri(
|
||||
|
Reference in New Issue
Block a user