Refactoring the code for pub sub (#155)
- We were using the attribute name 'channel' to store pubsub tokens, which was confusing. - switched to faker from ffaker - spec for contact.rb
This commit is contained in:
@@ -108,9 +108,9 @@ export default {
|
||||
}
|
||||
return false;
|
||||
},
|
||||
getChannel() {
|
||||
getPubSubToken() {
|
||||
if (this.isLoggedIn()) {
|
||||
return Cookies.getJSON('user').channel;
|
||||
return Cookies.getJSON('user').pubsub_token;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
|
||||
@@ -63,7 +63,7 @@ export default {
|
||||
const pusher = new VuePusher(CONSTANTS.PUSHER.token, options);
|
||||
// Add to global Obj
|
||||
if (AuthAPI.isLoggedIn()) {
|
||||
pusher.subscribe(AuthAPI.getChannel());
|
||||
pusher.subscribe(AuthAPI.getPubSubToken());
|
||||
return pusher.pusher;
|
||||
}
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user