Skip to content

Commit

Permalink
Optimize the jump logic from the shared link to open the app
Browse files Browse the repository at this point in the history
优化从分享链接打开app的跳转逻辑
  • Loading branch information
jiangtian616 committed Nov 2, 2024
1 parent fb16434 commit 4dda744
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 3 additions & 1 deletion changelog/v8.0.5+267.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
- 优化搜索标签提示
- 适配E站不再能查看非本人上传画廊的排行数据的变动
- 优化从分享链接打开app的跳转逻辑

--------------------

- Optimize the search tag prompt
- Adapt to the change that users can no longer view the ranking data of galleries uploaded by others
- Adapt to the change that users can no longer view the ranking data of galleries uploaded by others
- Optimize the jump logic from the shared link to open the app
10 changes: 6 additions & 4 deletions lib/src/pages/home_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ class _HomePageState extends State<HomePage> with LoginRequiredMixin, WindowList
}

SharedMediaFile file = files.first;
if (file.type != SharedMediaType.url) {
if (file.type != SharedMediaType.url && file.type != SharedMediaType.text) {
return;
}

Expand Down Expand Up @@ -160,14 +160,15 @@ class _HomePageState extends State<HomePage> with LoginRequiredMixin, WindowList
if (files.isEmpty) {
return;
}

SharedMediaFile file = files.first;
if (file.type != SharedMediaType.url) {
if (file.type != SharedMediaType.url && file.type != SharedMediaType.text) {
return;
}

GalleryUrl? galleryUrl = GalleryUrl.tryParse(file.path);
if (galleryUrl != null) {
untilRoute(currentRoute: Routes.details, predicate: (route) => route.settings.name != Routes.read);
toRoute(
Routes.details,
arguments: DetailsPageArgument(galleryUrl: galleryUrl),
Expand All @@ -179,6 +180,7 @@ class _HomePageState extends State<HomePage> with LoginRequiredMixin, WindowList

GalleryImagePageUrl? galleryImagePageUrl = GalleryImagePageUrl.tryParse(file.path);
if (galleryImagePageUrl != null) {
untilRoute(currentRoute: Routes.details, predicate: (route) => route.settings.name != Routes.read);
toRoute(
Routes.imagePage,
arguments: GalleryImagePageArgument(galleryImagePageUrl: galleryImagePageUrl),
Expand Down

0 comments on commit 4dda744

Please sign in to comment.