MCPcopy Index your code
hub / github.com/jsfiddle/togetherjs / initIdentityId

Function initIdentityId

togetherjs/session.js:253–270  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

251 }
252
253 function initIdentityId() {
254 return util.Deferred(function (def) {
255 if (session.identityId) {
256 def.resolve();
257 return;
258 }
259 storage.get("identityId").then(function (identityId) {
260 if (! identityId) {
261 identityId = util.generateId();
262 storage.set("identityId", identityId);
263 }
264 session.identityId = identityId;
265 // We don't actually have to wait for the set to succede, so
266 // long as session.identityId is set
267 def.resolve();
268 });
269 });
270 }
271
272 initIdentityId.done = initIdentityId();
273

Callers 1

session.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected