fix: GoRouter captures receive sharing intents sometimes
This commit is contained in:
parent
e427c84c02
commit
dcdaededd2
2 changed files with 6 additions and 1 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import 'dart:async';
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
|
|
@ -306,7 +307,7 @@ class ChatListController extends State<ChatList>
|
|||
|
||||
void _processIncomingSharedMedia(List<SharedMediaFile> files) {
|
||||
if (files.isEmpty) return;
|
||||
|
||||
inspect(files);
|
||||
if (files.singleOrNull?.path.startsWith(AppConfig.deepLinkPrefix) == true) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,6 +39,10 @@ class FluffyChatApp extends StatelessWidget {
|
|||
routes: AppRoutes.routes,
|
||||
debugLogDiagnostics: true,
|
||||
redirect: (context, state) {
|
||||
// Workaround for content sharings passed to go router:
|
||||
if (state.uri.scheme == 'content') return null;
|
||||
|
||||
// Pass deep links to app:
|
||||
if (state.uri.toString().startsWith(AppConfig.deepLinkPrefix)) {
|
||||
return '/rooms/newprivatechat?deeplink=${state.uri}';
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue