fix errors

This commit is contained in:
Bruno Windels 2019-02-06 22:06:33 +00:00
parent 5c7a1f66d6
commit d6857a1ede
2 changed files with 3 additions and 3 deletions

View File

@ -7,7 +7,7 @@ async function getLoginData(username, password) {
const storedCredentials = localStorage.getItem("morpheus_login");
if (!storedCredentials) {
const api = new Network(HOMESERVER);
loginData = await api.passwordLogin(username, password).response();
const loginData = await api.passwordLogin(username, password).response();
localStorage.setItem("morpheus_login", JSON.stringify(loginData));
return loginData;
} else {

View File

@ -10,8 +10,8 @@ export function openDatabase(name, createObjectStore, version = undefined) {
export function reqAsPromise(req) {
return new Promise((resolve, reject) => {
txn.addEventListener("success", event => resolve(event.target.result));
txn.addEventListener("error", event => reject(event.target.error));
req.addEventListener("success", event => resolve(event.target.result));
req.addEventListener("error", event => reject(event.target.error));
});
}