Skip to content

Commit

Permalink
Use && instead of ||.
Browse files Browse the repository at this point in the history
  • Loading branch information
rtibbles committed Aug 2, 2017
1 parent f48b438 commit 760decf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kolibri/plugins/user/assets/src/views/sign-in-page/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
});
},
setSuggestionTerm(newVal, oldVal) {
if (newVal !== null || typeof newVal !== 'undefined') {
if (newVal !== null && typeof newVal !== 'undefined') {

This comment has been minimized.

Copy link
@indirectlylit

indirectlylit Aug 2, 2017

Contributor

some claim it's cleaner to just check !== undefined

This comment has been minimized.

Copy link
@rtibbles

rtibbles Aug 2, 2017

Author Member

Old habits die hard :)

// Only check if defined or not null
if (newVal.length < 3) {
// Don't search for suggestions if less than 3 characters entered
Expand Down Expand Up @@ -190,7 +190,7 @@
},
fillUsername(username) {
// Only do this if we have been passed a non-null value
if (username !== null || typeof username !== 'undefined') {
if (username !== null && typeof username !== 'undefined') {
this.username = username;
this.showDropdown = false;
}
Expand Down

0 comments on commit 760decf

Please sign in to comment.