confirm delete, extension load actions

This commit is contained in:
Mo Bitar
2017-01-29 16:59:06 -06:00
parent 2274e6835d
commit 72afcd7da4
8 changed files with 36 additions and 22 deletions

View File

@@ -39,8 +39,8 @@ angular.module('app.frontend')
callback(response.plain());
})
.catch(function(response){
console.log("Error getting current user", response);
callback(response.data);
console.log("Error getting auth params", response);
callback(null);
})
}
@@ -59,7 +59,7 @@ angular.module('app.frontend')
this.login = function(url, email, password, callback) {
this.getAuthParamsForEmail(url, email, function(authParams){
if(!authParams) {
callback({error: "Unable to get authentication parameters."});
callback({error : {message: "Unable to get authentication parameters."}});
return;
}
@@ -72,6 +72,8 @@ angular.module('app.frontend')
return;
}
console.log("compute encryption keys", password, authParams);
Neeto.crypto.computeEncryptionKeysForUser(_.merge({password: password}, authParams), function(keys){
var mk = keys.mk;
var requestUrl = url + "/auth/sign_in";
@@ -112,7 +114,7 @@ angular.module('app.frontend')
}.bind(this))
.catch(function(response){
console.log("Registration error", response);
callback(response.data);
callback(null);
})
}.bind(this));
}

View File

@@ -103,7 +103,9 @@ class DBManager {
var request = db.transaction("items", "readwrite").objectStore("items").delete(item.uuid);
request.onsuccess = function(event) {
console.log("Successfully deleted item", item.uuid);
callback(true);
if(callback) {
callback(true);
}
};
}, null)
}

View File

@@ -10,7 +10,7 @@ class SyncManager {
}
get serverURL() {
return localStorage.getItem("server") || "http://localhost:3000";
return localStorage.getItem("server") || "https://n3.standardnotes.org";
}
get masterKey() {