Commit 66d6b154 authored by Jens-Christian Fischer's avatar Jens-Christian Fischer
Browse files

Fixed check for unitialized p5 object

parent 055c9db0
......@@ -172,12 +172,12 @@ let PresenceSketch = {
width: 720,
height: 400,
boids: {},
p5: {},
p5: null,
presences: {},
addBoids(joins) {
if !(PresenceSketch.p5) { return; };
if (!PresenceSketch.p5) { return; };
_.each(joins, function(val, name) {
if (name) {
......@@ -191,7 +191,7 @@ let PresenceSketch = {
removeBoids(leaves) {
if !(PresenceSketch.p5) { return; };
if (!PresenceSketch.p5) { return; };
_.each(leaves, function(val, name) {
delete PresenceSketch.boids[name];
});
......@@ -201,7 +201,7 @@ let PresenceSketch = {
syncBoids(currentActive) {
if !(PresenceSketch.p5) { return; };
if (!PresenceSketch.p5) { return; };
console.log("sync");
_.each(currentActive, function(p) {
console.log(p.user);
......
Supports Markdown
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