mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-23 22:12:34 +01:00
chore: Remove workaround of initialUrl
This commit is contained in:
parent
30011f4761
commit
0fb9218b89
@ -28,16 +28,10 @@ import 'package:vrouter/vrouter.dart';
|
||||
|
||||
class AppRoutes {
|
||||
final bool columnMode;
|
||||
final String initialUrl;
|
||||
|
||||
AppRoutes(this.columnMode, {this.initialUrl});
|
||||
AppRoutes(this.columnMode);
|
||||
|
||||
List<VRouteElement> get routes => [
|
||||
if (initialUrl != null && initialUrl != '/')
|
||||
VRouteRedirector(
|
||||
path: '/',
|
||||
redirectTo: initialUrl,
|
||||
),
|
||||
..._homeRoutes,
|
||||
if (columnMode) ..._tabletRoutes,
|
||||
if (!columnMode) ..._mobileRoutes,
|
||||
|
@ -85,6 +85,7 @@ class _FluffyChatAppState extends State<FluffyChatApp> {
|
||||
columnMode ??= newColumns > 1;
|
||||
_router ??= GlobalKey<VRouterState>();
|
||||
if (columnMode != newColumns > 1) {
|
||||
Logs().v('Set Column Mode = $columnMode');
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
setState(() {
|
||||
_initialUrl = _router.currentState.url;
|
||||
@ -104,7 +105,7 @@ class _FluffyChatAppState extends State<FluffyChatApp> {
|
||||
locale: kIsWeb
|
||||
? Locale(html.window.navigator.language.split('-').first)
|
||||
: null,
|
||||
routes: AppRoutes(columnMode, initialUrl: _initialUrl).routes,
|
||||
routes: AppRoutes(columnMode).routes,
|
||||
builder: (context, child) {
|
||||
LoadingDialog.defaultTitle = L10n.of(context).loadingPleaseWait;
|
||||
LoadingDialog.defaultBackLabel = L10n.of(context).close;
|
||||
|
Loading…
Reference in New Issue
Block a user