TF-1074 Handle go to path /dashboard
This commit is contained in:
@@ -13,6 +13,7 @@ import 'package:tmail_ui_user/features/base/base_controller.dart';
|
||||
import 'package:tmail_ui_user/features/caching/caching_manager.dart';
|
||||
import 'package:tmail_ui_user/features/caching/config/hive_cache_config.dart';
|
||||
import 'package:tmail_ui_user/features/login/data/network/config/authorization_interceptors.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/state/get_authenticated_account_state.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/state/get_credential_state.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/state/get_stored_token_oidc_state.dart';
|
||||
import 'package:tmail_ui_user/features/login/domain/usecases/delete_authority_oidc_interactor.dart';
|
||||
@@ -63,6 +64,8 @@ abstract class ReloadableController extends BaseController {
|
||||
log('ReloadableController::onData(): LogoutOidcFailure: $failure');
|
||||
} else if (failure is GetStoredTokenOidcFailure) {
|
||||
_goToLogin(arguments: LoginArguments(LoginFormType.ssoForm));
|
||||
} else if (failure is GetAuthenticatedAccountFailure || failure is NoAuthenticatedAccountFailure) {
|
||||
_goToLogin(arguments: LoginArguments(LoginFormType.credentialForm));
|
||||
}
|
||||
},
|
||||
(success) {
|
||||
|
||||
@@ -20,7 +20,7 @@ class GetAuthenticatedAccountSuccess extends UIState {
|
||||
}
|
||||
|
||||
class GetAuthenticatedAccountFailure extends FeatureFailure {
|
||||
final exception;
|
||||
final dynamic exception;
|
||||
|
||||
GetAuthenticatedAccountFailure(this.exception);
|
||||
|
||||
|
||||
+5
-9
@@ -163,13 +163,9 @@ class MailboxDashBoardController extends ReloadableController {
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
log('MailboxDashBoardController::onReady()');
|
||||
dispatchRoute(DashboardRoutes.thread);
|
||||
_registerPendingEmailAddress();
|
||||
_registerPendingFileInfo();
|
||||
_setSessionCurrent();
|
||||
_getUserProfile();
|
||||
_getVacationResponse();
|
||||
_getSessionCurrent();
|
||||
_getAppVersion();
|
||||
super.onReady();
|
||||
}
|
||||
@@ -326,18 +322,18 @@ class MailboxDashBoardController extends ReloadableController {
|
||||
userProfile.value = sessionCurrent != null ? UserProfile(sessionCurrent!.username.value) : null;
|
||||
}
|
||||
|
||||
void _setSessionCurrent() {
|
||||
void _getSessionCurrent() {
|
||||
final arguments = Get.arguments;
|
||||
log('MailboxDashBoardController::_setSessionCurrent(): arguments = $arguments');
|
||||
if (arguments is Session) {
|
||||
sessionCurrent = arguments;
|
||||
accountId.value = sessionCurrent?.accounts.keys.first;
|
||||
_getUserProfile();
|
||||
injectAutoCompleteBindings(sessionCurrent, accountId.value);
|
||||
injectVacationBindings(sessionCurrent, accountId.value);
|
||||
_getVacationResponse();
|
||||
} else {
|
||||
if (kIsWeb) {
|
||||
reload();
|
||||
}
|
||||
reload();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,6 +59,6 @@ class CoreBindings extends Bindings {
|
||||
void _bindingUtils() {
|
||||
Get.put(const Uuid());
|
||||
Get.put(CompressFileUtils());
|
||||
Get.lazyPut(() => AppConfigLoader());
|
||||
Get.put(AppConfigLoader());
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'package:core/core.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:get/get_navigation/src/routes/get_route.dart';
|
||||
import 'package:tmail_ui_user/features/composer/presentation/composer_bindings.dart';
|
||||
@@ -47,13 +48,14 @@ class AppPages {
|
||||
name: AppRoutes.dashboard,
|
||||
page: () => DeferredWidget(mailbox_dashboard.loadLibrary, () => mailbox_dashboard.MailboxDashBoardView()),
|
||||
binding: MailboxDashBoardBindings()),
|
||||
GetPage(
|
||||
name: AppRoutes.composer,
|
||||
opaque: false,
|
||||
page: () {
|
||||
ComposerBindings().dependencies();
|
||||
return DeferredWidget(composer.loadLibrary, () => composer.ComposerView());
|
||||
}),
|
||||
if (!BuildUtils.isWeb)
|
||||
GetPage(
|
||||
name: AppRoutes.composer,
|
||||
opaque: false,
|
||||
page: () {
|
||||
ComposerBindings().dependencies();
|
||||
return DeferredWidget(composer.loadLibrary, () => composer.ComposerView());
|
||||
}),
|
||||
GetPage(
|
||||
name: AppRoutes.destinationPicker,
|
||||
opaque: false,
|
||||
|
||||
@@ -2,7 +2,7 @@ abstract class AppRoutes {
|
||||
static const home = '/';
|
||||
static const login = '/login';
|
||||
static const session = '/session';
|
||||
static const dashboard = '/dashBoard';
|
||||
static const dashboard = '/dashboard';
|
||||
static const composer = '/composer';
|
||||
static const destinationPicker = '/destination_picker';
|
||||
static const settings = '/settings';
|
||||
|
||||
Reference in New Issue
Block a user