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:
@ -28,9 +28,10 @@ import 'package:appflowy/workspace/application/user/prelude.dart';
|
||||
import 'package:appflowy/workspace/application/view/prelude.dart';
|
||||
import 'package:appflowy/workspace/application/workspace/prelude.dart';
|
||||
import 'package:appflowy/workspace/presentation/home/menu/menu_shared_state.dart';
|
||||
import 'package:appflowy_backend/log.dart';
|
||||
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
|
||||
import 'package:appflowy_backend/protobuf/flowy-user/protobuf.dart';
|
||||
import 'package:appflowy_editor/appflowy_editor.dart';
|
||||
import 'package:appflowy_editor/appflowy_editor.dart' hide Log;
|
||||
import 'package:flowy_infra/file_picker/file_picker_impl.dart';
|
||||
import 'package:flowy_infra/file_picker/file_picker_service.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
@ -55,6 +56,7 @@ class DependencyResolver {
|
||||
|
||||
Future<void> _resolveCloudDeps(GetIt getIt) async {
|
||||
final env = await AppFlowyCloudSharedEnv.fromEnv();
|
||||
Log.info("cloud setting: \n$env");
|
||||
getIt.registerFactory<AppFlowyCloudSharedEnv>(() => env);
|
||||
|
||||
if (isAppFlowyCloudEnabled) {
|
||||
|
@ -4,7 +4,6 @@ import 'dart:io';
|
||||
import 'package:appflowy/env/cloud_env.dart';
|
||||
import 'package:appflowy/workspace/application/settings/prelude.dart';
|
||||
import 'package:appflowy_backend/appflowy_backend.dart';
|
||||
import 'package:appflowy_backend/log.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get_it/get_it.dart';
|
||||
@ -139,9 +138,14 @@ Future<void> initGetIt(
|
||||
LaunchConfiguration config,
|
||||
) async {
|
||||
getIt.registerFactory<EntryPoint>(() => f);
|
||||
getIt.registerLazySingleton<FlowySDK>(() {
|
||||
return FlowySDK();
|
||||
});
|
||||
getIt.registerLazySingleton<FlowySDK>(
|
||||
() {
|
||||
return FlowySDK();
|
||||
},
|
||||
dispose: (sdk) async {
|
||||
await sdk.dispose();
|
||||
},
|
||||
);
|
||||
getIt.registerLazySingleton<AppLauncher>(
|
||||
() => AppLauncher(
|
||||
context: LaunchContext(
|
||||
@ -205,7 +209,6 @@ class AppLauncher {
|
||||
}
|
||||
|
||||
Future<void> dispose() async {
|
||||
Log.info('AppLauncher dispose');
|
||||
for (final task in tasks) {
|
||||
await task.dispose();
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ class AppFlowyCloudDeepLink {
|
||||
(_) async {
|
||||
final deviceId = await getDeviceId();
|
||||
final payload = OauthSignInPB(
|
||||
authType: AuthenticatorPB.AppFlowyCloud,
|
||||
authenticator: AuthenticatorPB.AppFlowyCloud,
|
||||
map: {
|
||||
AuthServiceMapKeys.signInURL: uri.toString(),
|
||||
AuthServiceMapKeys.deviceId: deviceId,
|
||||
|
Reference in New Issue
Block a user