JohnMcLear / draw

A real time collaborative drawing tool using nodejs, socket.io & paper.js
Apache License 2.0
482 stars 158 forks source link

removing a project after first user left #226

Closed srirammadduri closed 8 years ago

srirammadduri commented 8 years ago

Hi

i need to remove the project from list of projects after first user left.

Any Help

bytesnz commented 8 years ago

I have created an option that allows the deletion of a room after a specified time after the last person leaves the room (no one is left in the room) if that will do https://github.com/theelectricwiz/draw/blob/master/server.js#L60. It can either be specified as a command line argument, eg $ npm start -- --removeUnused=5 or in the settings file settings.json

srirammadduri commented 8 years ago

Thanks for quick reply @theelectricwiz.So i need to add this line in settings.json as "removeUnused": 5 instead of "removeUnused": undefined.

is that right

bytesnz commented 8 years ago

Yes, that will remove the room after 5 minutes of no one being in the room. Note, this will occur even if you accidentally loose your connection with the server (and don't reconnect within the 5 minutes).

srirammadduri commented 8 years ago

most of the time i got this error on loading time Uncaught TypeError: Cannot set property 'selected' of null

Any idea

bytesnz commented 8 years ago

@srirammadduri : Did you get anymore information with the error like a stack trace?

srirammadduri commented 8 years ago

Hi the room remove from database not from array of projetcs

{"projects":{"17928678wb1401":{"project":[["Layer",{"applyMatrix":true}]],"external_paths":{}},"17928632wb1401":{"project":[["Layer",{"applyMatrix":true}]],"external_paths":{}}}}

bytesnz commented 8 years ago

Ah. Will try and get that fixed tomorrow morning (GMT). https://github.com/theelectricwiz/draw/issues/2

srirammadduri commented 8 years ago

Thanks @theelectricwiz still this is an issue not yet fixed

bytesnz commented 8 years ago

@srirammadduri: Yes. If I fix problem with the room not being removed from the list, will this resolve this issue for you?

srirammadduri commented 8 years ago

if you remove the room from projects object it resolves my problem.

and also Thanks for your support

bytesnz commented 8 years ago

Ok. Will fix.. and no problem.

bytesnz commented 8 years ago

@srirammadduri: have fixed the issue https://github.com/theelectricwiz/draw/commit/5ea7dfe0bde8e2e790f91cd73ff7468193576d5e.

srirammadduri commented 8 years ago

Ok Thanks i will test it and let you know.

srirammadduri commented 8 years ago

Thanks man it's working

bytesnz commented 8 years ago

Sweet.

JohnMcLear commented 8 years ago

tnx @theelectricwiz