fix: unable to open mentioned page on mobile (#5151)

This commit is contained in:
Lucas.Xu 2024-04-18 10:18:26 +08:00 committed by GitHub
parent 8ccc879ef5
commit d4fe957f24
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,4 +1,5 @@
import 'package:appflowy/generated/flowy_svgs.g.dart';
import 'package:appflowy/mobile/application/mobile_router.dart';
import 'package:appflowy/plugins/base/emoji/emoji_text.dart';
import 'package:appflowy/plugins/trash/application/trash_service.dart';
import 'package:appflowy/startup/startup.dart';
@ -7,7 +8,8 @@ import 'package:appflowy/workspace/application/view/prelude.dart';
import 'package:appflowy/workspace/application/view/view_ext.dart';
import 'package:appflowy_backend/log.dart';
import 'package:appflowy_backend/protobuf/flowy-folder/protobuf.dart';
import 'package:appflowy_editor/appflowy_editor.dart' show EditorState;
import 'package:appflowy_editor/appflowy_editor.dart'
show EditorState, PlatformExtension;
import 'package:collection/collection.dart';
import 'package:flowy_infra_ui/flowy_infra_ui.dart';
import 'package:flowy_infra_ui/style_widget/hover.dart';
@ -116,12 +118,18 @@ class _MentionPageBlockState extends State<MentionPageBlock> {
Log.error('Page($pageId) not found');
return;
}
if (PlatformExtension.isDesktopOrWeb) {
getIt<TabsBloc>().add(
TabsEvent.openPlugin(
plugin: view.plugin(),
view: view,
),
);
} else {
if (mounted) {
await context.pushView(view);
}
}
}
Future<ViewPB?> fetchView(String pageId) async {