Skip to content

Commit 11093ef

Browse files
author
edencoder
committed
fix uuid
1 parent 3f004f7 commit 11093ef

File tree

4 files changed

+216
-306
lines changed

4 files changed

+216
-306
lines changed

bundles/socket/daemons/socket.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11

22
// Require dependencies
3-
import uuid from 'uuid';
4-
import config from 'config';
5-
import Daemon from 'daemon';
6-
import session from 'express-session';
7-
import socketio from 'socket.io';
8-
import SessionStore from '@edenjs/session-store';
9-
import cookieParser from 'cookie-parser';
3+
import config from 'config';
4+
import Daemon from 'daemon';
5+
import session from 'express-session';
6+
import socketio from 'socket.io';
7+
import SessionStore from '@edenjs/session-store';
8+
import cookieParser from 'cookie-parser';
9+
import { v4 as uuid } from 'uuid';
1010

1111
// require models
1212
const User = model('user');
@@ -82,9 +82,6 @@ export default class SocketDaemon extends Daemon {
8282
// Set io
8383
this.__socketIO = socketio(this.eden.router.app.server);
8484

85-
// Listen for connection
86-
this.__socketIO.on('connection', this.onConnect);
87-
8885
// initialize store
8986
SessionStore.initialize(session);
9087

@@ -124,6 +121,9 @@ export default class SocketDaemon extends Daemon {
124121
next();
125122
});
126123

124+
// Listen for connection
125+
this.__socketIO.on('connection', this.onConnect);
126+
127127
// user
128128
this.eden.on('socket.id', this.id, true);
129129

bundles/socket/public/js/bootstrap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
// Require dependencies
33
const io = require('socket.io-client');
4-
const uuid = require('uuid');
4+
const uuid = require('uuid').v4;
55

66
// Require local dependencies
77
const store = require('core/public/js/store');

0 commit comments

Comments
 (0)