Skip to content

Commit

Permalink
Line endings.
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMaksimize committed Mar 6, 2014
1 parent 0c75e50 commit d2a13cc
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
28 changes: 14 additions & 14 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,24 +191,24 @@ io.sockets.on('connection', function(socket) {
// @TODO use local socket to react differently for submitter.
noteController.saveNote(noteData, function(err, savedNote) {
if (err) {
console.log(err);
var flashErrors = [];
console.log(err);
var flashErrors = [];
var errorMessage = "Something happend and we couldn't save your note. Please try again.";
if (err.code == 11000) {
console.log('Dup Note.');
flashErrors.push({ type: 'danger', message: "A note like this already exists. Be creative!" });
flashErrors.push({ type: 'danger', message: "A note like this already exists. Be creative!" });
}
if (err.name == 'ValidationError') {
for (var errorPath in err.errors) {
var error = err.errors[errorPath];
console.log(error);
flashErrors.push({
type: 'danger',
message: error.message
});
}
}
socket.emit('appFlash', flashErrors);
if (err.name == 'ValidationError') {
for (var errorPath in err.errors) {
var error = err.errors[errorPath];
console.log(error);
flashErrors.push({
type: 'danger',
message: error.message
});
}
}
socket.emit('appFlash', flashErrors);
}
else {
io.sockets.emit('newNoteSaved', savedNote);
Expand Down
2 changes: 1 addition & 1 deletion public/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ $(document).ready(function() {
});
}
if (newNoteData.notes.length < 1) {
console.log('Unbind InView');
console.log('Unbind InView');
container.unbind('inview');
return;
}
Expand Down

0 comments on commit d2a13cc

Please sign in to comment.