Skip to content

Commit

Permalink
Merge pull request #950 from steniooliv/master
Browse files Browse the repository at this point in the history
fix: Corrige navegação ao ser direcionado via Deep Link
  • Loading branch information
jacobaraujo7 authored Apr 5, 2024
2 parents 7c549d8 + 6fed1be commit 93a7366
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ class ModularRouteInformationParser
final ReportPush reportPush;
final UrlService urlService;

bool _firstParse = false;

ModularRouteInformationParser({
required this.getRoute,
required this.getArguments,
Expand All @@ -36,23 +34,17 @@ class ModularRouteInformationParser
Future<ModularBook> parseRouteInformation(
RouteInformation routeInformation) async {
var path = '';
if (!_firstParse) {
// 3.10 wrapper
final location = [null].contains(routeInformation.location)
? '/'
: routeInformation.location!;
if (location == '/') {
// ignore: invalid_use_of_visible_for_testing_member
path = urlService.getPath() ?? Modular.initialRoutePath;
} else {
// 3.10 wrapper
path = location;
}

_firstParse = true;
} else {
// 3.10 wrapper
final location = [null].contains(routeInformation.uri.path)
? '/'
: routeInformation.uri.path;
if (location == '/') {
// ignore: invalid_use_of_visible_for_testing_member
path = urlService.getPath() ?? Modular.initialRoutePath;
} else {
// 3.10 wrapper
path = location;
}

return selectBook(path);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void main() {
});
test('should throw error not found bind', () {
when(() => injector.get<String>()).thenThrow(
const AutoInjectorException('String'),
AutoInjectorException('String'),
);
expect(
service.getBind<String>().fold(id, id),
Expand Down

0 comments on commit 93a7366

Please sign in to comment.