fix: always open the readme file (#2603)

This commit is contained in:
Lucas.Xu 2023-05-23 19:55:43 +08:00 committed by GitHub
parent 74ff6772db
commit 51a7954af7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,5 @@
import 'package:appflowy/plugins/document/application/document_data_pb_extension.dart';
import 'package:appflowy/plugins/document/application/editor_transaction_adapter.dart';
import 'package:appflowy/plugins/document/presentation/editor_plugins/migration/editor_migration.dart';
import 'package:appflowy/plugins/trash/application/trash_service.dart';
import 'package:appflowy/user/application/user_service.dart';
import 'package:appflowy/util/json_print.dart';
@ -15,7 +14,6 @@ import 'package:appflowy_editor/appflowy_editor.dart'
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
import 'package:appflowy_backend/protobuf/flowy-folder2/view.pb.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:dartz/dartz.dart';
@ -142,11 +140,7 @@ class DocumentBloc extends Bloc<DocumentEvent, DocumentState> {
return;
}
// test: read from asset
final readme = await rootBundle.loadString('assets/template/readme.json');
final readmeDocument = EditorMigration.migrateDocument(readme);
final editorState = EditorState(document: readmeDocument);
final editorState = EditorState(document: document);
this.editorState = editorState;
// subscribe to the document change from the editor