From 0d0c898726f55c321d6bda8d7843ee5785f60701 Mon Sep 17 00:00:00 2001 From: Yangfan Zhang Date: Tue, 28 Nov 2017 10:05:33 +0800 Subject: [PATCH] amended != to !== --- app/js/mutations/ChangeTodoStatusMutation.js | 2 +- app/js/mutations/MarkAllTodosMutation.js | 2 +- app/js/mutations/RemoveCompletedTodosMutation.js | 2 +- app/js/mutations/RemoveTodoMutation.js | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/js/mutations/ChangeTodoStatusMutation.js b/app/js/mutations/ChangeTodoStatusMutation.js index 2cb50e8..27d7b14 100644 --- a/app/js/mutations/ChangeTodoStatusMutation.js +++ b/app/js/mutations/ChangeTodoStatusMutation.js @@ -51,7 +51,7 @@ export default class ChangeTodoStatusMutation extends Relay.Mutation { var viewerPayload; if (this.props.viewer.todos) { viewerPayload = {id: this.props.viewer.id, todos: {}}; - if (this.props.viewer.todos.completedCount != null) { + if (this.props.viewer.todos.completedCount !== null) { viewerPayload.todos.completedCount = this.props.complete ? this.props.viewer.todos.completedCount + 1 : this.props.viewer.todos.completedCount - 1; diff --git a/app/js/mutations/MarkAllTodosMutation.js b/app/js/mutations/MarkAllTodosMutation.js index 5cb6a6d..40043bb 100644 --- a/app/js/mutations/MarkAllTodosMutation.js +++ b/app/js/mutations/MarkAllTodosMutation.js @@ -64,7 +64,7 @@ export default class MarkAllTodosMutation extends Relay.Mutation { }, })); } - if (this.props.todos.totalCount != null) { + if (this.props.todos.totalCount !== null) { viewerPayload.todos.completedCount = this.props.complete ? this.props.todos.totalCount : 0; diff --git a/app/js/mutations/RemoveCompletedTodosMutation.js b/app/js/mutations/RemoveCompletedTodosMutation.js index 2152856..c211686 100644 --- a/app/js/mutations/RemoveCompletedTodosMutation.js +++ b/app/js/mutations/RemoveCompletedTodosMutation.js @@ -52,7 +52,7 @@ export default class RemoveCompletedTodosMutation extends Relay.Mutation { var newTotalCount; if (this.props.todos) { var {completedCount, totalCount} = this.props.todos; - if (completedCount != null && totalCount != null) { + if (completedCount !== null && totalCount !== null) { newTotalCount = totalCount - completedCount; } if (this.props.todos.edges) { diff --git a/app/js/mutations/RemoveTodoMutation.js b/app/js/mutations/RemoveTodoMutation.js index 88460f7..a674370 100644 --- a/app/js/mutations/RemoveTodoMutation.js +++ b/app/js/mutations/RemoveTodoMutation.js @@ -52,12 +52,12 @@ export default class RemoveTodoMutation extends Relay.Mutation { var viewerPayload; if (this.props.viewer.todos) { viewerPayload = {id: this.props.viewer.id, todos: {}}; - if (this.props.viewer.todos.completedCount != null) { + if (this.props.viewer.todos.completedCount !== null) { viewerPayload.todos.completedCount = this.props.todo.complete === true ? this.props.viewer.todos.completedCount - 1 : this.props.viewer.todos.completedCount; } - if (this.props.viewer.todos.totalCount != null) { + if (this.props.viewer.todos.totalCount !== null) { viewerPayload.todos.totalCount = this.props.viewer.todos.totalCount - 1; } }