code cleanup

This commit is contained in:
Synox 2016-07-03 20:02:26 +02:00
parent 2436a256a1
commit 4673331801

View File

@ -7,11 +7,10 @@ class MailboxController {
this.mailboxService = mailboxService; this.mailboxService = mailboxService;
this.loadingData = true; this.loadingData = true;
this.mails = []; this.mails = [];
this.address = null; this.address = null; // is set when mails are loaded
} }
$onInit() { $onInit() {
this.username = this.mailboxService.getCurrentUsername();
this.intervalPromise = this.$interval(() => this.loadMails(), this.config.reload_interval_ms); this.intervalPromise = this.$interval(() => this.loadMails(), this.config.reload_interval_ms);
this.loadMails(); this.loadMails();
@ -24,7 +23,7 @@ class MailboxController {
loadMails() { loadMails() {
this.mailboxService.loadEmails(this.username) this.mailboxService.loadEmails(this.mailboxService.getCurrentUsername())
.then(data => { .then(data => {
this.mails = data.mails; this.mails = data.mails;
this.address = this.mailboxService.getCurrentAddress(); this.address = this.mailboxService.getCurrentAddress();