offline fixes

This commit is contained in:
Mo Bitar
2017-01-09 09:15:17 -06:00
parent 2ac3382b6d
commit 818f6aafe9
9 changed files with 277 additions and 271 deletions

View File

@@ -152,7 +152,7 @@ angular.module('app.frontend')
saveTimeout = $timeout(function(){
this.noteStatus = "Saving...";
this.saveNote();
}.bind(this), 150)
}.bind(this), 275)
}

View File

@@ -2,9 +2,7 @@ angular.module('app.frontend')
.directive("header", function(apiController, extensionManager){
return {
restrict: 'E',
scope: {
logout: "&"
},
scope: {},
templateUrl: 'frontend/header.html',
replace: true,
controller: 'HeaderCtrl',
@@ -90,7 +88,6 @@ angular.module('app.frontend')
this.signOutPressed = function() {
this.showAccountMenu = false;
this.logout()();
apiController.signout();
window.location.reload();
}
@@ -194,13 +191,18 @@ angular.module('app.frontend')
}
this.performImport = function(data, password) {
apiController.importJSONData(data, password, function(success, response){
console.log("import response", success, response);
if(success) {
this.importData = null;
} else {
alert("There was an error importing your data. Please try again.");
}
this.importData.loading = true;
// allow loading indicator to come up with timeout
$timeout(function(){
apiController.importJSONData(data, password, function(success, response){
console.log("Import response:", success, response);
this.importData.loading = false;
if(success) {
this.importData = null;
} else {
alert("There was an error importing your data. Please try again.");
}
}.bind(this))
}.bind(this))
}

View File

@@ -131,14 +131,4 @@ angular.module('app.frontend')
apiController.sync(null);
}
/*
Header Ctrl Callbacks
*/
$scope.headerLogout = function() {
apiController.clearLocalStorage();
}
});