diff --git a/src/services/syncService.js b/src/services/syncService.js index 7babfc1ae2..f7aada7f8d 100644 --- a/src/services/syncService.js +++ b/src/services/syncService.js @@ -107,74 +107,6 @@ function initSyncService() { return deferred.promise } - function syncFolders(serverFolders, callback) { - var self = this; - - self.userService.isAuthenticated(function (isAuthenticated) { - if (!isAuthenticated) { - callback(); - return; - } - - self.userService.getUserId(function (userId) { - self.folderService.getAll(function (folders) { - var localFolders = {}; - for (var i = 0; i < folders.length; i++) { - localFolders[folders[i].id] = folders[i]; - } - - var data = []; - for (var j = 0; j < serverFolders.length; j++) { - var serverFolder = serverFolders[j]; - var existingLocalFolder = localFolders[serverFolder.id]; - - if (!existingLocalFolder || existingLocalFolder.RevisionDate !== serverFolder.RevisionDate) { - data.push(new FolderData(serverFolder, userId)); - } - } - - self.folderService.upsert(data, function () { - callback(); - }); - }); - }); - }); - } - - function syncLogins(serverLogins, callback) { - var self = this; - - self.userService.isAuthenticated(function (isAuthenticated) { - if (!isAuthenticated) { - callback(); - return; - } - - self.userService.getUserId(function (userId) { - self.loginService.getAll(function (logins) { - var localLogins = {}; - for (var i = 0; i < logins.length; i++) { - localLogins[logins[i].id] = logins[i]; - } - - var data = []; - for (var j = 0; j < serverLogins.length; j++) { - var serverLogin = serverLogins[j]; - var existingLocalLogin = localLogins[serverLogin.id]; - - if (!existingLocalLogin || existingLocalLogin.RevisionDate !== serverLogin.RevisionDate) { - data.push(new LoginData(serverLogin, userId)); - } - } - - self.loginService.upsert(data, function () { - callback(); - }); - }); - }); - }); - } - function syncSettings(userId) { var deferred = Q.defer(); var self = this;