mirror of
https://github.com/bitwarden/browser.git
synced 2024-10-21 07:46:38 +02:00
26 lines
743 B
JavaScript
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';
|
|
}
|
|
});
|
|
}
|
|
});
|