Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var self = this;
- self.redirect = function(isGuest){
- isGuest = (typeof isGuest !== 'undefined' ? isGuest : false);
- var url = '';
- if (isGuest) {
- url = self.get('controllers.application.configs.site_url')+'/chat?chatRemoteID=0&remoteGuestId='+remoteId+'&topicId=undefined&nocache='+ new Date().getTime();
- } else {
- url = self.get('controllers.application.configs.site_url')+'/chat?chatRemoteID='+remoteId+'&topicId=undefined&nocache='+ new Date().getTime();
- }
- window.open(url,'_blank');
- }
- if (consultId){
- this.store.fetchById('consultation', consultId).then(function(c){
- var unreadMsgCount = c.get('unreadMsgCount');
- self.decrementProperty('controllers.application.configs.totalUnreadMsg', unreadMsgCount);
- c.set('unreadMsgCount', 0);
- if (c.get('remoteUser.isGuest')){
- self.redirect(true);
- } else {
- self.redirect();
- }
- });
- } else {
- self.redirect();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement