1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-10-21 07:46:38 +02:00
bitwarden-browser/src/popup/app/settings/settingsSyncController.js
Kyle Spearrin 2b6b75737e sync page
2016-09-21 19:30:08 -04:00

26 lines
743 B
JavaScript

angular
.module('bit.settings')
.controller('settingsSyncController', function ($scope, syncService, toastr) {
$scope.lastSync = '--';
setLastSync();
$scope.sync = function () {
syncService.fullSync(function () {
toastr.success('Syncing complete');
setLastSync();
});
};
function setLastSync() {
syncService.getLastSync(function (lastSync) {
if (lastSync) {
$scope.lastSync = lastSync.toLocaleDateString() + ' ' + lastSync.toLocaleTimeString();
}
else {
$scope.lastSync = 'Never';
}
});
}
});