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"); const storedCredentials = localStorage.getItem("morpheus_login");
if (!storedCredentials) { if (!storedCredentials) {
const api = new Network(HOMESERVER); 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)); localStorage.setItem("morpheus_login", JSON.stringify(loginData));
return loginData; return loginData;
} else { } else {

View file

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