-
Notifications
You must be signed in to change notification settings - Fork 292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ES6: Migrate 'view_model' #1236
Conversation
c43dd03
to
18886a1
Compare
1342c53
to
40d57a1
Compare
], | ||
}; | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove empty line
}); | ||
this.posted_mode_verify = ko.pureComputed(() => { | ||
return this.posted_mode() === z.auth.AuthView.MODE.POSTED_VERIFY; | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functions in lines 248-262 can all be replaced by the short version:
this.posted_mode_verify = ko.pureComputed(() => this.posted_mode() === z.auth.AuthView.MODE.POSTED_VERIFY);
}) | ||
.then(() => { | ||
return this.user_service.change_own_email(this.username()); | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Short function could be applied here, too.
let payload = {}; | ||
const username = this.username() | ||
.trim() | ||
.toLowerCase(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const username = this.username().trim().toLowerCase();
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linter will fail
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
More than two.. :) it's too deep..
this.state(GiphyViewModel.STATE.ERROR); | ||
}); | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove empty line
let main_css_classes = `main-accent-color-${this.user().accent_id()}`; | ||
main_css_classes += ` ${this.user().accent_theme()}`; | ||
main_css_classes += ' show'; | ||
return main_css_classes; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const main_css_classes = `main-accent-color-${this.user().accent_id()} ${this.user().accent_theme()} show';
or
let main_css_classes = `main-accent-color-${this.user().accent_id()} `;
main_css_classes += this.user().accent_theme();
main_css_classes += ' show';
this.calls = this.calling_repository.calls; | ||
this.joined_call = this.calling_repository.joined_call; | ||
|
||
this.videod_call = ko.pureComputed(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't it be this.video_call
(everywhere)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No
db7c798
to
32aef09
Compare
43989af
to
b79bacd
Compare
No description provided.