Commit a3418f7c authored by Sean Hammond's avatar Sean Hammond

Use falsiness/truthiness

parent cbc3b3e6
...@@ -112,7 +112,7 @@ function AnnotationController( ...@@ -112,7 +112,7 @@ function AnnotationController(
vm.timestamp = null; vm.timestamp = null;
model = $scope.annotationGet(); model = $scope.annotationGet();
if (model.user === undefined) { if (!model.user) {
model.user = session.state.userid; model.user = session.state.userid;
} }
...@@ -276,7 +276,7 @@ function AnnotationController( ...@@ -276,7 +276,7 @@ function AnnotationController(
if (!drafts.get(model)) { if (!drafts.get(model)) {
updateDraft(model); updateDraft(model);
} }
vm.action = model.id !== null ? 'edit' : 'create'; vm.action = model.id ? 'edit' : 'create';
vm.editing = true; vm.editing = true;
vm.preview = 'no'; vm.preview = 'no';
}; };
...@@ -561,7 +561,7 @@ function AnnotationController( ...@@ -561,7 +561,7 @@ function AnnotationController(
}, true); }, true);
$scope.$on(events.USER_CHANGED, function() { $scope.$on(events.USER_CHANGED, function() {
if (model.user === null) { if (!model.user) {
model.user = session.state.userid; model.user = session.state.userid;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment