Avoid displaying duplicate session expiration dialogs
Signed-off-by: dab246 <tdvu@linagora.com>
This commit is contained in:
@@ -231,6 +231,8 @@ abstract class BaseController extends GetxController
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (twakeAppManager.isSessionExpiresDialogOpened) return;
|
||||||
|
|
||||||
final appLocalizations = AppLocalizations.of(currentContext!);
|
final appLocalizations = AppLocalizations.of(currentContext!);
|
||||||
showConfirmDialogAction(
|
showConfirmDialogAction(
|
||||||
currentContext!,
|
currentContext!,
|
||||||
@@ -242,10 +244,21 @@ abstract class BaseController extends GetxController
|
|||||||
outsideDismissible: false,
|
outsideDismissible: false,
|
||||||
titleActionButtonMaxLines: 1,
|
titleActionButtonMaxLines: 1,
|
||||||
icon: SvgPicture.asset(imagePaths.icTMailLogo, width: 64, height: 64),
|
icon: SvgPicture.asset(imagePaths.icTMailLogo, width: 64, height: 64),
|
||||||
onConfirmAction: _performSaveAndReconnection,
|
onConfirmAction: () {
|
||||||
onCancelAction: _performReconnection,
|
twakeAppManager.setSessionExpiresDialogDisplayState(false);
|
||||||
onCloseButtonAction: _performCloseReconnectionConfirmDialog
|
_performSaveAndReconnection();
|
||||||
);
|
},
|
||||||
|
onCancelAction: () {
|
||||||
|
twakeAppManager.setSessionExpiresDialogDisplayState(false);
|
||||||
|
_performReconnection();
|
||||||
|
},
|
||||||
|
onCloseButtonAction: () {
|
||||||
|
twakeAppManager.setSessionExpiresDialogDisplayState(false);
|
||||||
|
_performCloseReconnectionConfirmDialog();
|
||||||
|
}
|
||||||
|
).whenComplete(() => twakeAppManager.setSessionExpiresDialogDisplayState(false));
|
||||||
|
|
||||||
|
twakeAppManager.setSessionExpiresDialogDisplayState(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void _performSaveAndReconnection() {
|
void _performSaveAndReconnection() {
|
||||||
@@ -265,6 +278,7 @@ abstract class BaseController extends GetxController
|
|||||||
}
|
}
|
||||||
|
|
||||||
void onDataFailureViewState(Failure failure) {
|
void onDataFailureViewState(Failure failure) {
|
||||||
|
log('$runtimeType::onDataFailureViewState:failure = ${failure.runtimeType}');
|
||||||
if (failure is FeatureFailure) {
|
if (failure is FeatureFailure) {
|
||||||
final isUrgentException = validateUrgentException(failure.exception);
|
final isUrgentException = validateUrgentException(failure.exception);
|
||||||
if (isUrgentException) {
|
if (isUrgentException) {
|
||||||
|
|||||||
@@ -1,8 +1,13 @@
|
|||||||
|
|
||||||
class TwakeAppManager {
|
class TwakeAppManager {
|
||||||
bool _hasComposer = false;
|
bool _hasComposer = false;
|
||||||
|
bool _isSessionExpiresDialogOpened = false;
|
||||||
|
|
||||||
void setHasComposer(bool value) => _hasComposer = value;
|
void setHasComposer(bool value) => _hasComposer = value;
|
||||||
|
|
||||||
bool get hasComposer => _hasComposer;
|
bool get hasComposer => _hasComposer;
|
||||||
|
|
||||||
|
void setSessionExpiresDialogDisplayState(bool value) => _isSessionExpiresDialogOpened = value;
|
||||||
|
|
||||||
|
bool get isSessionExpiresDialogOpened => _isSessionExpiresDialogOpened;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user