Sync resolution menu
This commit is contained in:
@@ -116,6 +116,10 @@ angular.module('app')
|
||||
this.closeAllRooms();
|
||||
}
|
||||
|
||||
this.toggleSyncResolutionMenu = function() {
|
||||
this.showSyncResolution = !this.showSyncResolution;
|
||||
}.bind(this);
|
||||
|
||||
this.closeAccountMenu = () => {
|
||||
this.showAccountMenu = false;
|
||||
}
|
||||
|
||||
@@ -292,8 +292,8 @@ class AccountMenu {
|
||||
}
|
||||
|
||||
$scope.importJSONData = function(data, password, callback) {
|
||||
var onDataReady = (errorCount) => {
|
||||
var items = modelManager.importItems(data.items);
|
||||
var onDataReady = async (errorCount) => {
|
||||
var items = await modelManager.importItems(data.items);
|
||||
for(var item of items) {
|
||||
// We don't want to activate any components during import process in case of exceptions
|
||||
// breaking up the import proccess
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
class SyncResolutionMenu {
|
||||
|
||||
constructor() {
|
||||
this.restrict = "E";
|
||||
this.templateUrl = "directives/sync-resolution-menu.html";
|
||||
this.scope = {
|
||||
"closeFunction" : "&"
|
||||
};
|
||||
}
|
||||
|
||||
controller($scope, modelManager, syncManager, archiveManager, $timeout) {
|
||||
'ngInject';
|
||||
|
||||
$scope.status = {};
|
||||
|
||||
$scope.close = function() {
|
||||
$timeout(() => {
|
||||
$scope.closeFunction()();
|
||||
})
|
||||
}
|
||||
|
||||
$scope.downloadBackup = function(encrypted) {
|
||||
archiveManager.downloadBackup(encrypted);
|
||||
$scope.status.backupFinished = true;
|
||||
}
|
||||
|
||||
$scope.skipBackup = function() {
|
||||
$scope.status.backupFinished = true;
|
||||
}
|
||||
|
||||
$scope.performSyncResolution = function() {
|
||||
$scope.status.resolving = true;
|
||||
syncManager.resolveOutOfSync().then(() => {
|
||||
$scope.status.resolving = false;
|
||||
$scope.status.attemptedResolution = true;
|
||||
if(syncManager.isOutOfSync()) {
|
||||
$scope.status.fail = true;
|
||||
} else {
|
||||
$scope.status.success = true;
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
angular.module('app').directive('syncResolutionMenu', () => new SyncResolutionMenu);
|
||||
Reference in New Issue
Block a user