(function () {
    'use strict';
    angular.module('listings')
        .factory('BookmarkServ', function ($q, url, $rootScope, toastr, $state, users, $firebaseObject, $firebaseArray, FbGenServ, userAuth) {
            ;
            return {

                add: function (home) {
                    return $q(function (resolve, reject) {

                        if (!userAuth.profile) {
                            toastr.warning('Please login to save home to bookmarks', {timeout: 10000});
                            $state.go('app.login');
                            return;
                        }
                        var savePath = url + 'bookmarks/' + userAuth.profile.userName + '/';
                        var saveObj = {};
                        saveObj[home] = true;

                        FbGenServ.saveObject(savePath, saveObj).then(function (ref) {
                            resolve();
                        });

                    });
                },
                remove: function (home,isBookmarkState) {
                    return $q(function (resolve, reject) {

                        if (!userAuth.profile) {
                            toastr.warning('Please login to save home to bookmarks', {timeout: 10000});
                            $state.go('app.login');
                            return;
                        }
                        var savePath = url + 'bookmarks/' + userAuth.profile.userName + '/';
                        var saveObj = {};
                        saveObj[home] = true;

                        FbGenServ.removeObj(savePath, saveObj).then(function (ref) {
                            if (isBookmarkState) {
                                $rootScope.$broadcast('bookmark:deleted', home);
                            }
                            resolve();
                        });

                    });
                },
                getAuthUserBookmarks: function () {

                    return $q(function (resolve, reject) {
                        var fbUrl = url + 'bookmarks/' + userAuth.profile.userName;
                        var fbArr = $firebaseArray(new Firebase(fbUrl));
                        fbArr.$loaded().then(function () {
                            resolve(fbArr);
                        })
                    })
                }
            };
        });
})();

@@ -1020,16 +1020,17 @@
 n (home,
+ 
 isBookma
@@ -2015,24 +2015,149 @@
 , reject) %7B%0A
+                        if (!userAuth.profile) %7B%0A                            reject();%0A                        %7D else %7B%0A%0A    
             
@@ -2248,24 +2248,28 @@
             
+ 
+   
 var fbArr = 
@@ -2329,16 +2329,20 @@
         
+    
 fbArr.$l
@@ -2364,24 +2364,28 @@
 nction () %7B%0A
+    
             
@@ -2432,34 +2432,64 @@
                 
+    %7D)%0A                        
 %7D
-)
 %0A               

Add real social media links #55