added handling of importing a backup

This commit is contained in:
Gordon Hall 2014-06-03 15:48:27 -04:00
commit 11c1157f9e
3 changed files with 24 additions and 4 deletions

View file

@ -19,6 +19,17 @@ angular.module('copay.import').controller('ImportController',
});
};
$scope.openFileDialog = function() {
if (window.cshell) {
return cshell.send('backup:import');
}
$scope.choosefile = !$scope.choosefile;
};
$scope.openPasteArea = function() {
$scope.pastetext = !$scope.pastetext;
};
$scope.getFile = function() {
// If we use onloadend, we need to check the readyState.
reader.onloadend = function(evt) {
@ -48,7 +59,7 @@ angular.module('copay.import').controller('ImportController',
}
$scope.loading = true;
if (backupFile) {
reader.readAsBinaryString(backupFile);
}