mirror of
https://github.com/bitwarden/browser
synced 2025-12-22 11:13:46 +00:00
sync page
This commit is contained in:
@@ -1,6 +1,25 @@
|
||||
angular
|
||||
.module('bit.settings')
|
||||
|
||||
.controller('settingsSyncController', function ($scope) {
|
||||
.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';
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user