1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 00:33:44 +00:00

move sync upon login to vault controller initiated via state params.

This commit is contained in:
Kyle Spearrin
2016-09-26 20:29:23 -04:00
parent a59f7a4afc
commit d49f0fcac3
7 changed files with 29 additions and 25 deletions

View File

@@ -2,9 +2,16 @@
.module('bit.vault')
.controller('vaultController', function ($scope, $rootScope, siteService, folderService, $q, $state, $stateParams, toastr,
syncService) {
syncService, utilsService) {
$('#search').focus();
var syncOnLoad = $stateParams.syncOnLoad;
if (syncOnLoad) {
setTimeout(function () {
syncService.fullSync(function () { });
}, utilsService.isFirefox() ? 500 : 0);
}
var delayLoad = true;
$scope.loaded = true;
if (!$rootScope.vaultSites) {
@@ -21,7 +28,7 @@
setTimeout(setScrollY, 100);
setTimeout(loadVault, 1000);
}
else {
else if (!syncOnLoad) {
loadVault();
}
@@ -43,11 +50,10 @@
promises.push(sitePromise);
$q.all(promises).then(function () {
if (decSites.length || !syncService.syncInProgress) {
$scope.loaded = true;
$rootScope.vaultFolders = decFolders;
$rootScope.vaultSites = decSites;
}
$scope.loaded = true;
$rootScope.vaultFolders = decFolders;
$rootScope.vaultSites = decSites;
if (!delayLoad) {
setScrollY();
}