diff --git a/lib/presentation/mixins/connect_page_mixin.dart b/lib/presentation/mixins/connect_page_mixin.dart index de2aeaf7a9..8226c2f4f8 100644 --- a/lib/presentation/mixins/connect_page_mixin.dart +++ b/lib/presentation/mixins/connect_page_mixin.dart @@ -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; } }