Permalink
Browse files

Preventing ID overlap.

  • Loading branch information...
1 parent 93165a7 commit 674567947420ed9665b74508c019706102b45a91 Jonas Galvez committed Aug 29, 2010
Showing with 2 additions and 0 deletions.
  1. +2 −0 pagetalk.js
View
@@ -42,6 +42,8 @@ http_server.get('/voting-room/:id', function(req, res) {
http_server.post('/voting-room', function(req, res) {
var voting_room_id = create_random_id(10);
+ while(poorsman_mongodb.voting_rooms[voting_room_id])
+ voting_room_id = create_random_id(10);
var vr = poorsman_mongodb.voting_rooms[voting_room_id] = {};
res.redirect('/voting-room/' + voting_room_id);
});

0 comments on commit 6745679

Please sign in to comment.