Skip to content

Commit

Permalink
TW-2036: Fix missing some thing part when use `resetLocationPathWithL…
Browse files Browse the repository at this point in the history
…oginToken`
  • Loading branch information
nqhhdev committed Sep 21, 2024
1 parent 398bb5d commit e22e7bf
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/presentation/mixins/connect_page_mixin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,15 @@ mixin ConnectPageMixin {
}) {
final loginTokenExisted = getQueryParameter('loginToken') != null;
if (!loginTokenExisted) return;
html.window.history.replaceState({}, '', '/#/${route ?? 'rooms'}');
html.window.history.replaceState(
{},
'',
'${getBaseUrlBeforeHash(html.window.location.href)}#/${route ?? 'rooms'}',
);
}

String getBaseUrlBeforeHash(String fullUrl) {
final fragmentIndex = fullUrl.indexOf('#/');
return fragmentIndex != -1 ? fullUrl.substring(0, fragmentIndex) : fullUrl;
}
}

0 comments on commit e22e7bf

Please sign in to comment.