Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

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

Lucas.Xud4fe957f242d
diff --git a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mention/mention_page_block.dart b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mention/mention_page_block.dart
index fc32143ff9..34d392883f 100644
--- a/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mention/mention_page_block.dart
+++ b/frontend/appflowy_flutter/lib/plugins/document/presentation/editor_plugins/mention/mention_page_block.dart
@@ -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;
}
- getIt<TabsBloc>().add(
- TabsEvent.openPlugin(
- plugin: view.plugin(),
- view: view,
- ),
- );
+ 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 {