Skip to content

Commit

Permalink
cleanup users
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanong committed Mar 18, 2014
1 parent 71dda59 commit 9a5ec70
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/crawl.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ var store = require('./store');
var log = require('./log');

module.exports = function* (user) {
if (!~store.json.users.indexOf(user)) store.json.users.push(user);

var start = Date.now();
log.write({
context: 'user',
Expand Down Expand Up @@ -78,7 +80,6 @@ module.exports = function* (user) {
}

yield ch(true);
store.json.users[user] = items;
yield* store.put();

log.write({
Expand Down
2 changes: 1 addition & 1 deletion lib/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ var client = exports.client = knox.createClient({

// the actual object
exports.json = {
users: {},
users: [],
components: [],
};

Expand Down
3 changes: 2 additions & 1 deletion public/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ var form = document.querySelector('#patch');
form.addEventListener('submit', function (e) {
e.preventDefault();

var name = this.name.value.toLowerCase();
var name = this.name.value.toLowerCase().trim();
if (!name) return;
superagent.patch('/' + name).end();
this.name.value = '';
})
Expand Down

0 comments on commit 9a5ec70

Please sign in to comment.