(js) Improve handling of IMAP connection problem

Fixes #194
This commit is contained in:
Francis Lachapelle
2016-02-02 15:05:25 -05:00
parent 15dee723d4
commit cf91004ae6
3 changed files with 19 additions and 4 deletions
@@ -54,8 +54,10 @@
"Share" = "Share";
"Account" = "Account";
"Shared Account" = "Shared Account";
/* Empty right pane */
/* A mailbox is selected, but no message (only shown on large screens) */
"No message selected" = "No message selected";
/* No mailbox is selected (usually resulting from an IMAP connection problem) */
"No mailbox selected" = "No mailbox selected";
/* acls */
"Access rights to" = "Access rights to";
"For user" = "For user";
+11 -1
View File
@@ -188,7 +188,17 @@
</md-content>
</md-sidenav>
<section layout="column" class="layout-fill" ui-view="mailbox"><!-- messages list --></section>
<section layout="column" class="layout-fill" ui-view="mailbox">
<md-toolbar layout="row" layout-align="space-between center" class="toolbar-main">
<var:component className="UIxTopnavToolbarTemplate"/>
</md-toolbar>
<md-content class="md-flex layout-fill md-hue-1"
layout="column" layout-align="center center">
<div class="md-default-theme md-background md-fg md-hue-3 sg-md-title">
<var:string label:value="No mailbox selected"/>
</div>
</md-content>
</section>
</script>
<script type="text/ng-template" id="UIxMailFolderTemplate">
@@ -16,7 +16,6 @@
$stateProvider
.state('mail', {
url: '/Mail',
abstract: true,
views: {
mailboxes: {
templateUrl: 'UIxMailMainFrame', // UI/Templates/MailerUI/UIxMailMainFrame.wox
@@ -326,7 +325,11 @@
function runBlock($rootScope, $log, $state) {
$rootScope.$on('$stateChangeError', function(event, toState, toParams, fromState, fromParams, error) {
$log.error(error);
$state.go('mail');
event.preventDefault();
if (toState.name != 'mail.account.inbox')
$state.go('mail.account.inbox');
else
$state.go('mail');
});
$rootScope.$on('$routeChangeError', function(event, current, previous, rejection) {
$log.error(event, current, previous, rejection);