mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-03 22:47:03 +03:00
Improved knockout observables management to prevent memory leaks
This commit is contained in:
parent
b165a1de4f
commit
3eb6ab1ef7
46 changed files with 1020 additions and 1013 deletions
|
|
@ -1,5 +1,3 @@
|
|||
import ko from 'ko';
|
||||
|
||||
import { StorageResultType, Notification } from 'Common/Enums';
|
||||
import { getNotification } from 'Common/Translator';
|
||||
|
||||
|
|
@ -16,27 +14,25 @@ class AccountPopupView extends AbstractViewNext {
|
|||
constructor() {
|
||||
super();
|
||||
|
||||
this.isNew = ko.observable(true);
|
||||
this.addObservables({
|
||||
isNew: true,
|
||||
|
||||
this.email = ko.observable('');
|
||||
this.password = ko.observable('');
|
||||
email: '',
|
||||
password: '',
|
||||
|
||||
this.emailError = ko.observable(false);
|
||||
this.passwordError = ko.observable(false);
|
||||
emailError: false,
|
||||
passwordError: false,
|
||||
|
||||
this.email.subscribe(() => {
|
||||
this.emailError(false);
|
||||
submitRequest: false,
|
||||
submitError: '',
|
||||
submitErrorAdditional: '',
|
||||
|
||||
emailFocus: false
|
||||
});
|
||||
|
||||
this.password.subscribe(() => {
|
||||
this.passwordError(false);
|
||||
});
|
||||
this.email.subscribe(() => this.emailError(false));
|
||||
|
||||
this.submitRequest = ko.observable(false);
|
||||
this.submitError = ko.observable('');
|
||||
this.submitErrorAdditional = ko.observable('');
|
||||
|
||||
this.emailFocus = ko.observable(false);
|
||||
this.password.subscribe(() => this.passwordError(false));
|
||||
}
|
||||
|
||||
@command((self) => !self.submitRequest())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue