forked from mystiq/hydrogen-web
fix errors
This commit is contained in:
parent
5c7a1f66d6
commit
d6857a1ede
2 changed files with 3 additions and 3 deletions
|
@ -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 {
|
||||||
|
|
|
@ -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));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue